Guorilla Posted March 31, 2014 Share Posted March 31, 2014 Hello, In the product list, I want to change the add to cart button to a"view" button... So customers always have to view the product firts, before ordering... I think it's about this code: {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} {if ($product.allow_oosp || $product.quantity >= 0)} {if isset($static_token)} <a class="ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}&token={$static_token}", true)}" title="{l s='Add to cart'}">{l s='Add to cart'}</a> {else} <a class="ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}", true)} title="{l s='Add to cart'}">{l s='Add to cart'}</a> {/if} {else} <span class="exclusive">{l s='Add to cart'}</span> {/if} {/if} <a class="button" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a> I've tried a lot of things by adding: <a class="button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a> But no view button is shown then... Could someone please put me in the right direction? Thanks, Marco Link to comment Share on other sites More sharing options...
PascalVG Posted March 31, 2014 Share Posted March 31, 2014 (edited) Hi Marco, I think that you can just take out the whole Add to cart code: {* <-- add comment-start here {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} {if ($product.allow_oosp || $product.quantity >= 0)} {if isset($static_token)} <a class="ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}&token={$static_token}", true)}" title="{l s='Add to cart'}">{l s='Add to cart'}</a> {else} <a class="ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}", true)} title="{l s='Add to cart'}">{l s='Add to cart'}</a> {/if} {else} <span class="exclusive">{l s='Add to cart'}</span> {/if} {/if} and a comment-end below *} <a class="button" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a> This will just remove the whole Add to cart button from the list, and leaves the View button intact. Hope this is what you want, pascal. Edited March 31, 2014 by PascalVG (see edit history) Link to comment Share on other sites More sharing options...
Guorilla Posted March 31, 2014 Author Share Posted March 31, 2014 Hi Marco, I think that you can just take out the whole Add to cart code: {* <-- add comment-start here {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} {if ($product.allow_oosp || $product.quantity >= 0)} {if isset($static_token)} <a class="ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}&token={$static_token}", true)}" title="{l s='Add to cart'}">{l s='Add to cart'}</a> {else} <a class="ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}", true)} title="{l s='Add to cart'}">{l s='Add to cart'}</a> {/if} {else} <span class="exclusive">{l s='Add to cart'}</span> {/if} {/if} and a comment-end below *} <a class="button" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a> This will just remove the whole Add to cart button from the list, and leaves the View button intact. Hope this is what you want, pascal. Hello Pascal, I tried that, but the problem then is that the button isn't showing... Link to comment Share on other sites More sharing options...
PascalVG Posted March 31, 2014 Share Posted March 31, 2014 Hi Marco, Can you try again, and show me the exact result that you see afterwards in a screenshot? (Don't forget NOT to comment-out the last line...) pascal Link to comment Share on other sites More sharing options...
Guorilla Posted March 31, 2014 Author Share Posted March 31, 2014 Hello, Did exactly what you did... But not working, check the attachment... Link to comment Share on other sites More sharing options...
Guorilla Posted March 31, 2014 Author Share Posted March 31, 2014 {* {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} {if ($product.allow_oosp || $product.quantity >= 0)} {if isset($static_token)} <a class="ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}&token={$static_token}", true)}" title="{l s='Add to cart'}">{l s='Add to cart'}</a> {else} <a class="ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}", true)} title="{l s='Add to cart'}">{l s='Add to cart'}</a> {/if} {else} <a class="button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a> {/if} {/if} *} <a class="button" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a> Link to comment Share on other sites More sharing options...
PascalVG Posted March 31, 2014 Share Posted March 31, 2014 Hmm, strange... Do you have a link to the site? (not your boilies.nu site, right??) What PS version?? Link to comment Share on other sites More sharing options...
Guorilla Posted April 1, 2014 Author Share Posted April 1, 2014 Hmm, strange... Do you have a link to the site? (not your boilies.nu site, right??) What PS version?? Click here for the site PS 1.5.4 Link to comment Share on other sites More sharing options...
PascalVG Posted April 2, 2014 Share Posted April 2, 2014 Hi Marco, For some reason, somewhere in your css files (maybe just themes<your theme folder>/css/global.css, but can be somewhere else. (Can't really see where exactly as you have some optimization settings turned on (the CCC settings in Advanced Parameters->Performance) ) you have this piece of code: .grid li .center_block .product_flags, .grid li .center_block .product_desc, .grid li .right_block .on_sale, .grid li .right_block .discount, .grid li .right_block .button { display: none;} If you take out the display: none; line you will see this on your pages: Hope this helps, pascal Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now