开发者

Add to cart button in osCommerce keeps redirecting back to product page

I have an ebook item in osCommerce that includes product attributes. When I click the Add to Cart button from the index page it should go direc开发者_开发问答tly to the shopping_cart.php page. However, it only keeps redirecting the customer back to the product_info.php page.

Why is it doing that?


If the product has attributes osCommerce expects that you select one of them before adding the product to the cart. That's why it is redirecting you to the product detail page.


try this code: find if ($col === 0) {$new_prods_content .= '';} (around line 29)

below add this code:

$new_prods_content .= '<td width="30%" align="center" valign="top">
    <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . 
    $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 
    $new_products['products_image'], $new_products['products_name'], 
    SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . 
    tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . 
    $new_products['products_id']) . '">' . $new_products['products_name'] . 
    '</a><br />' . $currencies->display_price($new_products['products_price'], 
    tep_get_tax_rate($new_products['products_tax_class_id'])) . 
    '&nbsp&nbsp&nbsp' . tep_draw_button(IMAGE_BUTTON_IN_CART, null , 
    tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 
    'action=buy_now&products_id=' . $new_products['products_id'])) .'</td>';


       i have added this code for new products in index.php page and when customer clicks add to cart button, it will add the item to cart and show shopping_cart.php page. 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜