Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
litespeed_wiki:cache:lscps:customization_1_6 [2017/10/30 19:02]
Lisa Clarke [Customize Blockcart Template]
litespeed_wiki:cache:lscps:customization_1_6 [2020/08/11 19:14]
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== Customizing PrestaShop v1.6 for use with LSCWP ====== +~~REDIRECT>​https://docs.litespeedtech.com/lscache/lscps/settings/~~
- +
-The following widgets and features require further customization before they can be used with LSCPS: +
- +
-  *Viewed Products Block +
-  *Compare Products Feature +
-  *Blockcart Template +
- +
-===== Disable Viewed Products Block ===== +
- +
-{{:​litespeed_wiki:​cache:​lscps:​capture_viewedproducts.png?​direct&​800|}} +
- +
-The use of the **Viewed Products Block** module is not recommended as it is not cache friendly. Disable it in the **Modules List** area. +
- +
-===== Update Template for Compare Product Feature ===== +
- +
-If you are using the **Compare Product** feature, you will need to define an ESI block around it in order for it to work properly with LSCPS. +
- +
-Open the appropriate template file in an editor. The default template is located at ''​themes/default-bootstrap/product-compare.tpl''​ but if you have a custom theme, it will be under that theme'​s folder. +
- +
-Locate the following text: ''​{count($compared_products)}''​. +
- +
-Anywhere this text appears, surround it with LiteSpeed ESI hooks like so: +
- +
-<​code>​ +
-{hook h="​litespeedEsiBegin"​ m="​lsc_compareproduct"​ field="​comparedcount"​}{count($compared_products)}{hook h="​litespeedEsiEnd"​} +
-</code> +
- +
-**Note**: You must be careful not to add extra spaces or line breaks in between! +
- +
-This is the default template after the substitutions have been made. Your template should look similar: +
- +
-<​code>​ +
-{if $comparator_max_item} +
- <form method="​post"​ action="​{$link->​getPageLink('​products-comparison'​)|escape:'​html':'​UTF-8'​}"​ class="​compare-form">​ +
- <​button type="​submit"​ class="​btn btn-default button button-medium bt_compare bt_compare{if isset($paginationId)}_{$paginationId}{/if}" disabled="​disabled">​ +
-<​span>​{l s='​Compare'​} (<strong class="​total-compare-val">​{hook h="​litespeedEsiBegin"​ m="​lsc_compareproduct"​ field="​comparedcount"​}{count($compared_products)}{hook h="​litespeedEsiEnd"​}</​strong>​)<​i class="​icon-chevron-right right"></​i></​span>​ +
- </​button>​ +
- <input type="​hidden"​ name="​compare_product_count"​ class="​compare_product_count"​ +
-               ​value="​{hook h="​litespeedEsiBegin"​ m="​lsc_compareproduct"​ field="​comparedcount"​}{count($compared_products)}{hook h="​litespeedEsiEnd"​}"​ /> +
- <input type="​hidden"​ name="​compare_product_list"​ class="​compare_product_list"​ value=""​ /> +
- </​form>​ +
- {if !isset($paginationId) || $paginationId == ''​} +
- {addJsDefL name=min_item}{l s='​Please select at least one product'​ js=1}{/​addJsDefL} +
- {addJsDefL name=max_item}{l s='You cannot add more than %d product(s) to the product comparison'​ sprintf=$comparator_max_item js=1}{/​addJsDefL} +
- {addJsDef comparator_max_item=$comparator_max_item} +
- {addJsDef comparedProductsIds=$compared_products} +
- {/if} +
-{/if} +
-{addJsDef comparedProductsIds=$compared_products} +
-</​code>​ +
- +
-You'll notice that ''​{count($compared_products)}''​ appeared twice, and was surrounded with the ESI hooks both times. +
- +
-===== Customize Blockcart Template ===== +
-A pop-up overlay appears when an item is added to the cart, if the request hits the backend. If the request is served from cache, the overlay does not appear, though the cart is updated properly. This occurs in the default-bootstrap theme and others. +
- +
-{{:​litespeed_wiki:​cache:​lscps:​lscps-customization-01.png?​direct&​600|}} +
- +
-This is caused by the smarty template ''​active_overlay''​ counter. When the content is served from an ESI block as a separate request, the counter value becomes ''​2''​. So if you want this overlay to always show, you need to modify your theme'​s smarty template. +
- +
-Modify ''​your_active_theme/modules/blockcart/​blockcart.tpl''​ +
- +
-Locate the following lines: +
- +
-  {if !$PS_CATALOG_MODE && $active_overlay == 1} +
-  <div id="​layer_cart">​ +
- +
-change ​  +
-  {if !$PS_CATALOG_MODE && $active_overlay == 1} +
-   +
-to  +
-  {if !$PS_CATALOG_MODE && $active_overlay} +
- +
-Now the pop-up overlay will always appear. Please remember if you ever update your theme, you will need to apply these changes again. +
- +
  • Admin
  • Last modified: 2020/08/11 19:14
  • by Lisa Clarke