Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Add To Cart Button To View Product Rate Topic   - - - - -

 
  • happyhare
  • Member
  • Members
  • Join Date: 11-Jun 14
  • 48 posts

Posted 12 May 2018 - 09:56 PM #1

Hi All!

 

Sorry if this has been asked but I cant seem to find it.  I would like the ADD TO CART button in category view to link into the product instead of adding to the cart.  

 

Is there a way to do this?

 

thanks in advance

 

 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10952 posts

Posted 13 May 2018 - 03:09 PM #2

Stand way it's to click the name of the product to go to product details.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • happyhare
  • Member
  • Members
  • Join Date: 11-Jun 14
  • 48 posts

Posted 13 May 2018 - 09:53 PM #3

Hi,

 

Thanks for that.  which file does the change need to be made to...

 

 

thanks

 

 

 

 

 

 

 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18348 posts

Posted 14 May 2018 - 06:45 AM #4

design/themes/THEME/templates/common/product_data.tpl

 

replace

        {if $product.has_options && !$show_product_options && !$details_page}
            {if $but_role == "text"}
                {$opt_but_role="text"}
            {else}
                {$opt_but_role="action"}
            {/if}
            {include file="buttons/button.tpl" but_id="button_cart_`$obj_prefix``$obj_id`" but_text=__("select_options") but_href="products.view?product_id=`$product.product_id`" but_role=$opt_but_role but_name="" but_meta="ty-btn__primary ty-btn__big"}
        {else}
            {if $extra_button}{$extra_button nofilter} {/if}
                {include file="buttons/add_to_cart.tpl" but_id="button_cart_`$obj_prefix``$obj_id`" but_name="dispatch[checkout.add..`$obj_id`]" but_role=$but_role block_width=$block_width obj_id=$obj_id product=$product but_meta=$add_to_cart_meta}

            {assign var="cart_button_exists" value=true}
        {/if}

with

        {if !$details_page}
            {if $but_role == "text"}
                {$opt_but_role="text"}
            {else}
                {$opt_but_role="action"}
            {/if}
            {include file="buttons/button.tpl" but_id="button_cart_`$obj_prefix``$obj_id`" but_text=__("add_to_cart") but_href="products.view?product_id=`$product.product_id`" but_role=$opt_but_role but_name="" but_meta="ty-btn__primary ty-btn__big"}
        {else}
            {if $extra_button}{$extra_button nofilter} {/if}
                {include file="buttons/add_to_cart.tpl" but_id="button_cart_`$obj_prefix``$obj_id`" but_name="dispatch[checkout.add..`$obj_id`]" but_role=$but_role block_width=$block_width obj_id=$obj_id product=$product but_meta=$add_to_cart_meta}

            {assign var="cart_button_exists" value=true}
        {/if}

Then clear cache

 

If you are familiar with hooks, use the My changes module and products:add_to_cart hook


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • happyhare
  • Member
  • Members
  • Join Date: 11-Jun 14
  • 48 posts

Posted 14 May 2018 - 04:26 PM #5

Thanks very much for that eCom Lab! Worked a treat!!

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18348 posts

Posted 15 May 2018 - 07:45 AM #6

You are welcome!


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.