Jump to content

[SOLVED] Product Attributes: How do I ensure that a user selects an attribute before 'add to cart'?


Recommended Posts

Hi,

I have recently added a product that has multiple attributes.

When viewing the product, how to I remove the ability for the user to click on 'add to cart' before he/she has clicked on the product to see the full description / attribute selection screen.

Thanks in advance.

J.

Link to comment
Share on other sites

The easiest way to work around this problem is to remove the "Add to cart" button on the product listing pages on products with attributes. For example, change lines 21-25 of product-list.tpl in your theme's directory from:

{if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2}
   <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$base_dir}cart.php?add&id_product={$product.id_product|intval}&token={$static_token}" title="{l s='Add to cart'}">{l s='Add to cart'}
{else}
{l s='Add to cart'}
{/if}



to:

{if $product.id_product_attribute == 0}
{if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2}
   <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$base_dir}cart.php?add&id_product={$product.id_product|intval}&token={$static_token}" title="{l s='Add to cart'}">{l s='Add to cart'}
{else}
{l s='Add to cart'}
{/if}
{/if}

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...