I developed a Swift design where the client wished the price, quantity and add to cart be in the product page right side bar on desktop and in the body of the product page in mobile.
A simple thing using Bootstraps display classes - I thought.
So in desktop one quantity/price/carty squence was hidden (display:none and one visible and vice versa in mobile.
All worked except dynamic pricing stopped working,
To cut to the chase this is apparently because according to support:
So although display:none; Sellerdeck's scripts are still 'seeing it' as if it wasn't hidden.
This is a terrible shame as it seriously limits Sellerdeck's design flexibility which has always beed a key selling point as far as I am concerned.
I reasoned that if the desktop and mobile price layout elements and the desktop and mobile quantity layout elements were placed in separate files they could be included them according to viewport.
You cannot use php on a live site so I used a javascript method from https://www.w3schools.com/howto/howto_html_include.asp tested in principle here: https://www.webeg.net/javascript-include-both-js.html
Use View Source to see code and click the jsijc.js file to see the javascript.
Unfortunately in Sellerdeck using the price and quantity layout elements in the separate include files in the live site the actinic code in the included pages failed to render:
Please can anyone think of a workaround?
Here are the two mobile content files for include
ContentM
Content MQ
Thank you for looking
A simple thing using Bootstraps display classes - I thought.
So in desktop one quantity/price/carty squence was hidden (display:none and one visible and vice versa in mobile.
All worked except dynamic pricing stopped working,
To cut to the chase this is apparently because according to support:
unlike in our default design, the markup with the quantity box is duplicated, and the code assumes that there is only one. Only one of the two quantity boxes display at a time but the first one (at least on some pages) is found by the code whose value won’t change because it is the hidden one.
This is a terrible shame as it seriously limits Sellerdeck's design flexibility which has always beed a key selling point as far as I am concerned.
I reasoned that if the desktop and mobile price layout elements and the desktop and mobile quantity layout elements were placed in separate files they could be included them according to viewport.
You cannot use php on a live site so I used a javascript method from https://www.w3schools.com/howto/howto_html_include.asp tested in principle here: https://www.webeg.net/javascript-include-both-js.html
Use View Source to see code and click the jsijc.js file to see the javascript.
Unfortunately in Sellerdeck using the price and quantity layout elements in the separate include files in the live site the actinic code in the included pages failed to render:
Please can anyone think of a workaround?
Here are the two mobile content files for include
ContentM
Code:
<div w3-include-htmlm="contentm.html"></div><actinic:block if="%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e"> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsCustomerMessageUsed%22%20%2f%3e" > <Actinic:PRICE_EXPLANATION PROD_REF="<actinic:variable name="ProductID" />" COMPONENTID=-1><actinic:variable name="RetailCustomerMessage" /></Actinic:PRICE_EXPLANATION> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22PriceIsEnabled%22%20%2f%3e" > <Actinic:PRICES PROD_REF="<actinic:variable name="ProductID" />" RETAIL_PRICE_PROMPT="<actinic:variable name="ProductPriceDescription" />"> <actinic:variable name="PriceListRetail" /> </Actinic:PRICES> <actinic:block if="%3cactinic%3avariable%20name%3d%22UseDynamicPrices%22%20%2f%3e%20%3d%3d%20true%20AND%20%3cactinic%3avariable%20name%3d%22ProductComponentCount%22%20%2f%3e%20%3d%3d%200" > <actinic:variable name="ProductJavascriptLayout" /> </actinic:block> </actinic:block> <actinic:variable name="DynamicPrice" /> <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductPriceIsEnabled%22%20%2f%3e%20%3d%3d%20False" > <Actinic:NOTINB2B><actinic:variable name="ProductPriceNotEnabledMessage" /></Actinic:NOTINB2B> </actinic:block>
Code:
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsQuantityPromptShown%22%20%2f%3e%20AND%20%28%3cactinic%3avariable%20name%3d%22IsOutOfStockShown%22%20%2f%3e%20%3d%3d%20FALSE%29%20AND%20%28%3cactinic%3avariable%20name%3d%22IsCatalogSuspendedShown%22%20%2f%3e%20%3d%3d%20FALSE%29" > <actinic:block if="%3cactinic%3avariable%20name%3d%22CartButtonVisibleToAllCustomers%22%20%2f%3e" > <div class="d-flex flex-wrap align-items-end justify-content-between"> <fieldset class="form-group quantity-box w-50 w-md-100"> <div class="row align-items-center"> <div class="input-group col-12"> <!-- This code is used when the quantity box is visible to all customers --> <label><actinic:variable name="QuantityPrompt" /></label> <input class="form-control input-number text-center input-lg" type="number" name="Q_<actinic:variable name="ProductID" />" value="<actinic:variable name="DefaultQuantity" />" <actinic:block if="%3cactinic%3avariable%20name%3d%22UseDynamicPrices%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e%20%3d%3d%20FALSE%20AND%20%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e%20%3d%3d%20FALSE" >onpaste="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" selectable="false" />', <actinic:variable name="SectionID" selectable="false" />)" onkeyup="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" selectable="false" />', <actinic:variable name="SectionID" selectable="false" />)"</actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22UseDynamicPrices%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e%20%3d%3d%20FALSE" >onpaste="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" selectable="false" />', <actinic:variable name="SectionID" selectable="false" />, '<actinic:variable name="ShopID" selectable="false" />')" onkeyup="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" selectable="false" />', <actinic:variable name="SectionID" selectable="false" />, '<actinic:variable name="ShopID" selectable="false" />')"</actinic:block>/> </div> </div> </fieldset> </div> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22EnabledForCustomerGroupID%22%20%2f%3e%20%21%3d%20%22%22" > <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductPriceIsEnabled%22%20%2f%3e" > <div class="input-group"> <!-- This code is used when the quantity box is visible to retail customers, but not all other customer groups --> <Actinic:ShowForPriceSchedule Schedules="<actinic:variable name="EnabledForCustomerGroupID" />"> <span class="input-group-btn"> <button class="btn btn-lg btn-default btn-number inc quantityButton" type="button"> <b>-</b> </button> </span> <input class="form-control text-center input-lg" type="number" name="Q_<actinic:variable name="ProductID" />" value="<actinic:variable name="DefaultQuantity" />" <actinic:block if="%3cactinic%3avariable%20name%3d%22UseDynamicPrices%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e%20%3d%3d%20FALSE%20AND%20%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e%20%3d%3d%20FALSE" >onpaste="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />)" onkeyup="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />)" onmouseup="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />)"</actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22UseDynamicPrices%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e%20%3d%3d%20FALSE" >onpaste="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />, '<actinic:variable name="ShopID" />')" onkeyup="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />, '<actinic:variable name="ShopID" />')" onmouseup="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />, '<actinic:variable name="ShopID" />')"</actinic:block>/> <span class="input-group-btn"> <button class="btn btn-lg btn-default btn-number inc quantityButton" type="button"> <b>+</b> </button> </span> </div> <div class="add-to-cart w-100"> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsAddToCartButtonShown%22%20%2f%3e%20AND%20%0d%28%3cactinic%3avariable%20name%3d%22NumberAttributesInPushButtonGrid%22%20%2f%3e%20%3d%3d%200%29" > <actinic:variable name="AddToCartButton" value="Add To Cart Button" /> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsOutOfStockShown%22%20%2f%3e" > <span class="btn-danger btn"><actinic:variable name="OutOfStock" /></span> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsCatalogSuspendedShown%22%20%2f%3e" > <span class="btn-danger btn"><actinic:variable name="CatalogSuspended" /></span> </actinic:block> </div> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductPriceIsEnabled%22%20%2f%3e%20%3d%3d%20FALSE" > <div class="input-group"> <!-- This code is used when the quantity box needs to hidden from retail customers --> <span class="input-group-btn"> <button class="btn btn-lg btn-default" type="button"> <b>-</b> </button> </span> <actinic:block if="%3cactinic%3avariable%20name%3d%22UseDynamicPrices%22%20%2f%3e%20%3d%3d%20FALSE%20OR%20%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e%20%3d%3d%20TRUE" > <Actinic:ShowForPriceSchedule Schedules="<actinic:variable name="EnabledForCustomerGroupID" />" HTML="<label><span class='actrequired'><actinic:variable name="QuantityPrompt" /></span></label><input class="form-control input-lg text-center" type='number' name='Q_<actinic:variable name="ProductID" />' value='<actinic:variable name="DefaultQuantity" />' />"></Actinic:ShowForPriceSchedule> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22UseDynamicPrices%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e%20%3d%3d%20FALSE%20AND%20%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e%20%3d%3d%20FALSE" > <Actinic:ShowForPriceSchedule Schedules="<actinic:variable name="EnabledForCustomerGroupID" />" HTML="<label><span class='actrequired'><actinic:variable name="QuantityPrompt" /></span></label><input class="form-control input-lg text-center" type='number' name='Q_<actinic:variable name="ProductID" />' value='<actinic:variable name="DefaultQuantity" />' onpaste=QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />) onkeyup=QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />) onmouseup=QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />)/>"></Actinic:ShowForPriceSchedule> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22UseDynamicPrices%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e%20%3d%3d%20FALSE" > <Actinic:ShowForPriceSchedule Schedules="<actinic:variable name="EnabledForCustomerGroupID" />" HTML="<label><span class='actrequired'><actinic:variable name="QuantityPrompt" /></span></label><input class="form-control input-lg text-center" type='number' name='Q_<actinic:variable name="ProductID" />' value='<actinic:variable name="DefaultQuantity" />' onpaste=QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />, '<actinic:variable name="ShopID" />') onkeyup=QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />, '<actinic:variable name="ShopID" />') onmouseup=QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />, '<actinic:variable name="ShopID" />')/>"></Actinic:ShowForPriceSchedule> </actinic:block> <span class="input-group-btn"> <button class="btn btn-lg btn-default" type="button"> <b>+</b> </button> </span> </div> <div class="add-to-cart w-100 a2"> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsAddToCartButtonShown%22%20%2f%3e%20AND%20%0d%28%3cactinic%3avariable%20name%3d%22NumberAttributesInPushButtonGrid%22%20%2f%3e%20%3d%3d%200%29" > <actinic:variable name="AddToCartButton" value="Add To Cart Button" /> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsOutOfStockShown%22%20%2f%3e" > <span class="btn-danger btn"><actinic:variable name="OutOfStock" /></span> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsCatalogSuspendedShown%22%20%2f%3e" > <span class="btn-danger btn"><actinic:variable name="CatalogSuspended" /></span> </actinic:block> </div> </actinic:block> </actinic:block> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsQuantityPromptHidden%22%20%2f%3e" > <fieldset class="quantity-box"> <input type="hidden" name="Q_<actinic:variable name="ProductID" />" value="<actinic:variable name="DefaultQuantity" />" /> </fieldset> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsOtherInfoPromptShown%22%20%2f%3e" > <fieldset class="product-prompt"> <label><span class="actrequired"><actinic:variable encoding="actinic" name="OtherInfoPrompt" /></span></label> <input class="form-control" type="text" name="O_<actinic:variable name="ProductID" />" maxlength="1000" value="" /> </fieldset> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsDatePromptShown%22%20%2f%3e" > <fieldset class="product-prompt"> <label><span class="actrequired"><actinic:variable name="DatePrompt" /></span></label> <actinic:variable name="DayList" /><actinic:variable name="MonthList" /><actinic:variable name="YearList" /> </fieldset> </actinic:block> <actinic:variable name="ProductLinks" /> <actinic:block if="%3cactinic%3avariable%20name%3d%22ShowPriceMatchDelImage%22%20%2f%3e"> <img class="mb-4" src="<actinic:variable name="PriceMatchDelImage" />" width="190" height="50" alt="If you have seen this item cheaper on any other website then call us and we will try to match or beat if possible."> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22DiscountDescriptionIsShownForProducts%22%20%2f%3e" > <actinic:variable name="DiscountList" value="Standard Discount List" /> </actinic:block> <div class="d-flex flex-wrap ml-md-3 mt-md-2"> <actinic:block if="%3cactinic%3avariable%20name%3d%22CartButtonVisibleToAllCustomers%22%20%2f%3e" > <div class="add-to-cart"> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsAddToCartButtonShown%22%20%2f%3e%20AND%20%0d%28%3cactinic%3avariable%20name%3d%22NumberAttributesInPushButtonGrid%22%20%2f%3e%20%3d%3d%200%29" > <actinic:variable name="AddToCartButton" value="Add To Cart Button" /> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsCatalogSuspendedShown%22%20%2f%3e" > <span class="btn theme-danger-btn"><actinic:variable name="CatalogSuspended" /></span> </actinic:block> </div> </actinic:block> <div class="d-none d-md-block feefoproductlogo-sec"> <actinic:variable name="FeefoProductLogo" /> </div> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsWishListEnabled%22%20%2f%3e%20%3d%3d%20true" > <actinic:variable name="AddToWishListBtn" /> </actinic:block> </div>
Comment