Zen Cart Logo
Forums / General Questions / Add to cart link doesn't work

Add to cart link doesn't work

Locked

Views: 984

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
29 Nov 2010, 6:16 PM
#1
panuma avatar

panuma

New Zenner

Join Date:
Jun 2010
Location:
Buenos Aires
Posts:
48
Plugin Contributions:
0

Add to cart link doesn't work

Hi there,

In the product info pages, the link "add this to my cart" on the right doesn't work. Any idea?

A second issue: I'd like to change the link of button "back to shopping" in the shopping cart page, but I can't find where to change it.

thanks

29 Nov 2010, 7:46 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Add to cart link doesn't work

Your Add to Cart code is outside of the <form> tags ... :blink:

29 Nov 2010, 8:12 PM
#3
panuma avatar

panuma

New Zenner

Join Date:
Jun 2010
Location:
Buenos Aires
Posts:
48
Plugin Contributions:
0

Re: Add to cart link doesn't work

Thanks Ajeh but I can't find the file where to change it, even using the developer tool :(
Same thing for the shopping cart buttons..

29 Nov 2010, 8:36 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Add to cart link doesn't work

The problem would be in the:
/includes/templates/your_template_dir/templates/tpl_product_info_display.php

compare it to the original in:
/includes/templates/template_default/templates/tpl_product_info_display.php

30 Nov 2010, 1:46 AM
#5
panuma avatar

panuma

New Zenner

Join Date:
Jun 2010
Location:
Buenos Aires
Posts:
48
Plugin Contributions:
0

Re: Add to cart link doesn't work

I've replaced the code with the original one and it still doesn't work. It didn't find where the tags are missing:

<!--bof Add to Cart Box --> <?php if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') { // do nothing } else { ?>
        <?php
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
        if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
          // hide the quantity box and default to 1
          $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        } else {
          // show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        }
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);

?>

<?php if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
  echo $display_qty;
  echo $display_button;
        ?>
      </div>
<?php } // display qty and button ?> <?php } // CUSTOMERS_APPROVAL == 3 ?> <!--eof Add to Cart Box-->
30 Nov 2010, 4:42 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Add to cart link doesn't work

In the file you will see the start of the form:

<!--bof Form start-->
<?php echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product', $request_type), 'post', 'enctype="multipart/form-data"') . "\n"; ?>
<!--eof Form start-->

then the close of the form:

<!--bof Form close-->
</form>
<!--bof Form close-->

The Add to cart code has to be between those two some where ...

Your Add to Cart code is above the:

<!--bof Form start-->
30 Nov 2010, 6:46 PM
#7
panuma avatar

panuma

New Zenner

Join Date:
Jun 2010
Location:
Buenos Aires
Posts:
48
Plugin Contributions:
0

Re: Add to cart link doesn't work

Ok I get it now, thank a lot Ajeh, have a good day!