Jump to content

Manque bouton ajout panier sur modules nouveaux, promos, meilleures ventes


Recommended Posts

Il vous faut aller modifier leur fichier template (.tpl), que vous pouvez trouver en priorité dans :

 /themes/votretheme/modules/nomdumodule/nomdumodule.tpl

ou si il n'existe pas la, dans 

/modules/nomdumodule/nomdumodule.tpl

 

Et pour connaitre la structure du lien "ajouter au panier", prenez exemple sur le module homefeatured par exemple :)

Link to comment
Share on other sites

merci pour ta réponse super rapide

En revanche, cela ne fonctionne pas, j'ai copié ce code du homefeatured :

						{if ($product.id_product_attribute == 0 OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product.available_for_order AND !isset($restricted_country_mode) AND $product.minimal_quantity == 1 AND $product.customizable != 2 AND !$PS_CATALOG_MODE}
							{if ($product.quantity > 0 OR $product.allow_oosp)}
							<a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a>
							{else}
							<span class="exclusive">{l s='Add to cart' mod='homefeatured'}</span>
							{/if}
						{else}
							<div style="height:23px;"></div>
						{/if}

et je l'ai mis sur le bloc promo par exemple, le bouton ne s'affiche pas et j'ai des erreurs, et pas de bouton ajout panier :

Notice: Undefined index: product in xxx\cache\smarty\compile\5796c6b7ebf8992909405c2fb9cc609748dc17ba.file.blockspecials.tpl.php on line 87

Notice: Trying to get property of non-object in xxx\cache\smarty\compile\5796c6b7ebf8992909405c2fb9cc609748dc17ba.file.blockspecials.tpl.php on line 87

Notice: Undefined index: product in xxx\cache\smarty\compile\5796c6b7ebf8992909405c2fb9cc609748dc17ba.file.blockspecials.tpl.php on line 87

Notice: Trying to get property of non-object in xxx\cache\smarty\compile\5796c6b7ebf8992909405c2fb9cc609748dc17ba.file.blockspecials.tpl.php on line 87

Link to comment
Share on other sites

C'est normal.

Je pense que dans le template du bloc promo, $product n'existe pas.

Il utilise je pense $special. 

Il vous faut adapter un petit peu le code. Ne se servir d'home featured que comme un exemple ;)

De la même façon, que selon les template, on utilise $specials.price ou $specials->price par exemple (dans le cas du module Promo, c'est bien un .)

Edited by Szed (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...