Link the Buy Now Button to the Product Info Page in TomatoCart

When the customer click the buy now button in the store front, you might wish to redirect him to the product info page rather than add the product into the cart directly. This feature might be useful for some stores because they sell the products with a lot of variants. The customer just can select the variants in the product info page. Currently, there isn’t such feature in TomatoCart v1.x. But, you could customize some code to achieve it.

If you couldn’t do it by yourself, I suggest you find a developer or moderator in the TomatoCart community. If there is nobody prefer to help you, please contact technical support: support@tomatocart.com.

Note: the following solution is only for the v1.1.8 or high version

– For the buy now buttons in the product listing page:

1. Go to includes > modules > product_listing.php.

2. Find the following code:


if ($Qlisting->value('products_type') == PRODUCT_TYPE_SIMPLE) {
$lc_text = osc_link_object(osc_href_link(FILENAME_PRODUCT, $Qlisting->value('products_id')), osc_draw_image_button('button_buy_now.gif', $osC_Language->get('button_buy_now'))) . '
';
}else {
$lc_text = osc_link_object(osc_href_link(FILENAME_PRODUCT, $Qlisting->value('products_id')), osc_draw_image_button('button_buy_now.gif', $osC_Language->get('button_buy_now'))) . '
';
}

3. Replace it with the following code:


if ($Qlisting->value('products_type') == PRODUCT_TYPE_SIMPLE) {
$lc_text = osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qlisting->value('products_id')), osc_draw_image_button('button_buy_now.gif', $osC_Language->get('button_buy_now'))) . '
';
}else {
$lc_text = osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qlisting->value('products_id')), c) . '
';
}

– For the add to cart in the new products listing page:

1. Go to templates > glass_gray > content > products > new.php.

2. Find the following code:


echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), osc_draw_image_button('button_in_cart.gif', $osC_Language->get('button_add_to_cart'), 'class="ajaxAddToCart" id="ac_productsnew_' . $Qproducts->value('products_id') . '"'));

3. Replace it with the following code:


echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), osc_draw_image_button('button_buy_now.gif', $osC_Language->get('button_buy_now')));

– For buy now buttons in the new products content module

1. Go to includes > modules > content > new_products.php

2. Find the following code:


osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->valueInt('products_id')), osc_draw_image_button('button_add_to_cart.png', $osC_Language->get('button_add_to_cart'), 'class="ajaxAddToCart" id="ac_newproductsmodule_' . $Qnewproducts->value('products_id') . '"'));

3. Replace it with the following code:


osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->valueInt('products_id')), osc_draw_image_button('button_add_to_cart.png', $osC_Language->get('button_add_to_cart')));

Done. It’s simple. But, please backup the following files before doing it:

  1. includes > modules > product_listing.php
  2. includes > modules > content > new_products.php
  3. templates > glass_gray > content > products > new.php

Enjoy it.

Looking for quality TomatoCart Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , | Posted under TomatoCart | RSS 2.0

Author Spotlight

Jack Yin

Jack Yin

TomatoCart Developer & Co Founder - Arvixe Web Hosting / TomatoCart Community Liaison

Leave a Reply

Your email address will not be published. Required fields are marked *


1 + = 6

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>