Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add to cart and product not found! problem


mokx2280

Recommended Posts

Posted

When I try to click on the add to cart link for my products, it redirects me to my shopping cart but it doesn't add it. Also some of my products are displaying a product not found! message. I double checked and it exists in my admin pages and my index.php files work prefectly so I am not sure what is wrong.

Posted

What is your osC version?

At what page is this happening?

 

p.s. Maybe you can post the link where is this happening.

Posted

I would guess your buy it now problem is in includes/application_top.php

 

Sorry...not sure about the product not found message... unless, is it possible, the product is just inactive (or out of stock and you have set up something to make inactive when out of stock)? You would have to provide more details and some of the other experts may be able help (of which I am not one....lol).

 

For your add to cart issue, if it is stock 2.3.3, around line 311, it should look like this;

 

    if (DISPLAY_CART == 'true') {
     $goto =  FILENAME_SHOPPING_CART;
     $parameters = array('action', 'cPath', 'products_id', 'pid');
   } else {
     $goto = basename($PHP_SELF);
     if ($HTTP_GET_VARS['action'] == 'buy_now') {
       $parameters = array('action', 'pid', 'products_id');
     } else {
       $parameters = array('action', 'pid');
     }
   }

 

 

Posted

For my product not found messages, I think it is either because they were a limited time offer or I am out of stock? Not too sure about that right now. Also, for my add to cart issues, I checked for that code in my includes/application_top.php file and it is very similar so I am a bit confused about why it doesn't work. I uploaded it just in case I missed a stupid mistake that I should have fixed.

application_top.php

Posted

My Oscommerce version is 2.3.3 and this is happening at my home page. My add to cart link looks something like this "http://healthoriginal.com/index.php?action=buy_now&products_id=348&osCsid=493c740ffd6294a8d6f5c40b4878bc94"

 

Hi,

 

I had a similar problem and found it appeared when i selected not to be directed to the shopping cart when a customer added an item to their basket. Pretty sure it was something i had done or the template i used.

Posted

Again, I'm assuming you have something going on in application_top... You mentioned previously it was 2.3.3... This looks like 2.2...

 

Also, you have a bunch of addon's in here that could be causing an issue (again I'm no expert).

 

Look around line 660... You have;

 

      // performed by the 'buy now' button in product listings and review page
     case 'buy_now' : if (isset($_GET['products_id'])) {
           /*if (tep_has_product_attributes($_GET['products_id'])) {
             tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']));
           } else {*/
             $cart->add_cart($_GET['products_id'], $cart->get_quantity($_GET['products_id'])+1);
             // Begin Change: Cart Cookie V1.3
include('includes/write_cart_to_cookie.php');
// End Change: Cart Cookie V1.3
           //}
         }
         tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
         break;

 

out of the box should look something like;

 

// performed by the 'buy now' button in product listings and review page
     case 'buy_now' :        if (isset($HTTP_GET_VARS['products_id'])) {
                               if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
                                 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
                               } else {
                                 $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
                               }
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;

 

It's gonna require some trial and error on your part... or sign up for commercial help. I don't think anyone is going to dig through your file line by line...

 

Good luck...

Posted

Hi,

 

yes agree looks like a 2.2 to me also that first of all as the includes/configure.php wrong

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...