S
S
streetn12018-03-05 14:18:26
Smarty
streetn1, 2018-03-05 14:18:26

How to display product.cart.html on the main page?

Good afternoon. I am customizing the Shop-Script 7 template, it is necessary that the product.cart template be displayed on the main page. The problem is with the value of features_selected it becomes null. How to display this variable on the main one?
This is how I include the product.cart.html template in the home.html file.

{$products = $wa->shop->products()}
                
{foreach $products as $product}
   {include file="product.cart.html"}
{/foreach}

But this variable is not visible:
{foreach $features_selectable as $f}
{/foreach}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Reshetnyak, 2018-07-11
@Vampireos

Did it like this:

{* ВЫВОДИМ НА СТРАНИЦЕ ПРОДУКТА *}
{if strpos($smarty.server.REQUEST_URI,"/show-product/") !== false}

  контент

{* ВЫВОДИМ НА ГЛАВНОЙ *}
{elseif strpos($smarty.server.REQUEST_URI,"/base/") !== false}
 
  контент  

{* ВЫВОДИМ НА СТРАНИЦЕ ПРОДУКТОВ *}
{elseif strpos($smarty.server.REQUEST_URI,"/show-products/") !== false}

   контент  

{/if}

True, not in Shop-Script 7, but the template engine is also smarty.
We indicate what should be in the address, for example, "/show-product/" or "/base/"
..after re-reading the question, I realized that my answer seems to be off topic)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question