diff --git a/modules/productaccessories/productaccessories.php b/modules/productaccessories/productaccessories.php index c5d134a3..46cdf42d 100644 --- a/modules/productaccessories/productaccessories.php +++ b/modules/productaccessories/productaccessories.php @@ -100,9 +100,7 @@ class ProductAccessories extends Module } if(isset($showAccessories)) { - $context->smarty->assign(array('enable' => 1, 'label' => $label, 'showAccessories' => $showAccessories)); - } else { - $context->smarty->assign(array('enable' => 0)); + $context->smarty->assign(array('label' => $label, 'showAccessories' => $showAccessories)); } } diff --git a/themes/toutpratique/modules/productaccessories/views/templates/accessories.tpl b/themes/toutpratique/modules/productaccessories/views/templates/accessories.tpl index f44723d4..9e9d0b4f 100644 --- a/themes/toutpratique/modules/productaccessories/views/templates/accessories.tpl +++ b/themes/toutpratique/modules/productaccessories/views/templates/accessories.tpl @@ -1,130 +1,130 @@ +{if !empty($showAccessories)} +
+
+
+

{l s='Nos suggestions pour compléter votre panier' mod='productaccessories'}

+
+
    + {for $i=0 to ($showAccessories|@count-1)} - -
    -
    -
    -

    {l s='Nos suggestions pour compléter votre panier' mod='productaccessories'}

    -
    -
      - {for $i=0 to ($showAccessories|@count-1)} - - {if ($showAccessories[$i]!=null)} - {assign var='showAccessory' value=$showAccessories[$i]} - {assign var=percentReduction value=0} - {if isset($showAccessory['price_without_reduction']) && isset($showAccessory['price']) && $showAccessory['price']!= round($showAccessory['price_without_reduction'], 2)} - {math equation="round(100 - (price * 100 / price_without_reduction))" price=$showAccessory['price'] price_without_reduction=$showAccessory['price_without_reduction'] assign=percentReduction} - {/if} -
    • - - {if $percentReduction != 0} - - -{$percentReduction}% - + {if ($showAccessories[$i]!=null)} + {assign var='showAccessory' value=$showAccessories[$i]} + {assign var=percentReduction value=0} + {if isset($showAccessory['price_without_reduction']) && isset($showAccessory['price']) && $showAccessory['price']!= round($showAccessory['price_without_reduction'], 2)} + {math equation="round(100 - (price * 100 / price_without_reduction))" price=$showAccessory['price'] price_without_reduction=$showAccessory['price_without_reduction'] assign=percentReduction} {/if} -
      - - -
      - - - -
      -
      - -
      - {$showAccessory['product']->name|truncate:60} -
      - -
      - {foreach from=$showAccessory['features'] item='feature' name='feature'} - {if $feature.id_feature == 8} - {$feature.name} : {$feature.value} - {/if} - {/foreach} -
      - - {if ((isset($showAccessory['product']->show_price) && $showAccessory['product']->show_price) || (isset($showAccessory['product']->available_for_order) && $showAccessory['product']->available_for_order))} -
      - {if isset($showAccessory['product']->available_for_order) && $showAccessory['product']->available_for_order && !isset($restricted_country_mode)} - -
      - - - {if (isset($showAccessory['allow_oosp']) && $showAccessory['allow_oosp'] || $showAccessory['quantity'] > 0)} - - - - {if $showAccessory['quantity'] <= 0} - {if $showAccessory['allow_oosp']} - {if isset($showAccessory['product']->available_later) && $showAccessory['product']->available_later} - {l s='En réassort'} - {$showAccessory['product']->available_later} - {else} - {l s='En réassort'} - Expédition sous 15 jours - {/if} - {/if} - {else} - - {l s='En stock'} - Expédition sous 48h - - {/if} - {elseif (isset($showAccessory['product']->quantity_all_versions) && $showAccessory['product']->quantity_all_versions > 0)} - - {elseif (isset($showAccessory['product']->quantity_all_versions) && $showAccessory['product']->quantity_all_versions > 0)} - - {l s='Product available with different options'} - {else} - - {l s='Out of stock'} - {/if} - -
      - {/if} -
      - {/if} - +
    • + + {if $percentReduction != 0} + + -{$percentReduction}% + + {/if} +
      + -
      -

      - -
      -
      -
      -
      - {if isset($percentReduction) && $percentReduction > 0} - - {l s='au lieu de'} {displayPrice price=$showAccessory['price_without_reduction']} - - {/if} - {displayPrice price=$showAccessory['price']} - -
      -
      -
      - {if ($showAccessory['product']->id_product_attribute == 0 OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $showAccessory['product']->available_for_order AND !isset($restricted_country_mode) AND $showAccessory['product']->minimal_quantity == 1 AND $showAccessory['product']->customizable != 2} - {if ($showAccessory['quantity'] > 0 OR $showAccessory['product']->allow_oosp)} -

      - -

      - - - {/if} - {else} -
      - {/if} +
      + + + +
      +
      + +
      + {$showAccessory['product']->name|truncate:60} +
      + +
      + {foreach from=$showAccessory['features'] item='feature' name='feature'} + {if $feature.id_feature == 8} + {$feature.name} : {$feature.value} + {/if} + {/foreach} +
      + + {if ((isset($showAccessory['product']->show_price) && $showAccessory['product']->show_price) || (isset($showAccessory['product']->available_for_order) && $showAccessory['product']->available_for_order))} +
      + {if isset($showAccessory['product']->available_for_order) && $showAccessory['product']->available_for_order && !isset($restricted_country_mode)} + +
      + + + {if (isset($showAccessory['allow_oosp']) && $showAccessory['allow_oosp'] || $showAccessory['quantity'] > 0)} + + + + {if $showAccessory['quantity'] <= 0} + {if $showAccessory['allow_oosp']} + {if isset($showAccessory['product']->available_later) && $showAccessory['product']->available_later} + {l s='En réassort'} + {$showAccessory['product']->available_later} + {else} + {l s='En réassort'} + Expédition sous 15 jours + {/if} + {/if} + {else} + + {l s='En stock'} + Expédition sous 48h + + {/if} + {elseif (isset($showAccessory['product']->quantity_all_versions) && $showAccessory['product']->quantity_all_versions > 0)} + + {elseif (isset($showAccessory['product']->quantity_all_versions) && $showAccessory['product']->quantity_all_versions > 0)} + + {l s='Product available with different options'} + {else} + + {l s='Out of stock'} + {/if} + +
      + {/if} +
      + {/if} + + +
      +

      + +
      +
      +
      +
      + {if isset($percentReduction) && $percentReduction > 0} + + {l s='au lieu de'} {displayPrice price=$showAccessory['price_without_reduction']} + + {/if} + {displayPrice price=$showAccessory['price']} + +
      +
      +
      + {if ($showAccessory['product']->id_product_attribute == 0 OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $showAccessory['product']->available_for_order AND !isset($restricted_country_mode) AND $showAccessory['product']->minimal_quantity == 1 AND $showAccessory['product']->customizable != 2} + {if ($showAccessory['quantity'] > 0 OR $showAccessory['product']->allow_oosp)} +

      + +

      + + + {/if} + {else} +
      + {/if} +
      -
      -
      -
    • - {/if} - {/for} -
    +
    + + {/if} + {/for} +
+
-
-
- \ No newline at end of file + + +{/if} \ No newline at end of file