Forums / General Questions / What file or action causes attributes to be added to cart

What file or action causes attributes to be added to cart

Views: 749

Results 1 to 5 of 5
3 Feb 2013, 9:18 PM
#1
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

What file or action causes attributes to be added to cart

Working on upgrading a 1.3.9h to 1.5.1 site

Merged custom files into 1.5.1 versions

This site has custom code that displays attributes on the product listing page

In the 1.3.9h site adding to cart from the product listing page yields a correct add to cart with correct price

In the 1.5.1 site - adding to cart from the product listing page yields a product added BUT $0.00 as the cost

Modifications originally were added to the column-grid product listing plugin

No other plugins except for this custom code which is not a plugin available

Relevent code block change in /includes/modules/product_listing.php

        if (isset($_GET['manufacturers_id'])) {
          $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION);
			
			require($template->get_template_dir('/tpl_modules_attributes_listing.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_listing.php');
			
			$lc_text .= '</div>' ;
			
        } else {
          $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION);

			require($template->get_template_dir('/tpl_modules_attributes_listing.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_listing.php');
				
			$lc_text .= '</div>' ;

Can provide additional data if I knew what to provide

Zen-Venom Get Bitten

3 Feb 2013, 11:02 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: What file or action causes attributes to be added to cart

The shopping cart class processes submitted POST parameters and adds the products and selected attributes to the cart, and is triggered by the main_cart_actions.php and extra_cart_actions folder scripts if any. Of course that all depends on the submitted FORM containing all the correct fields and values, so templates must be working properly too (valid HTML, not incorrectly nested, etc).

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Feb 2013, 11:36 PM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: What file or action causes attributes to be added to cart

Thank you for your response

Exactly where is the file main_cart_actions.php

Zen-Venom Get Bitten

3 Feb 2013, 11:59 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: What file or action causes attributes to be added to cart

Last time I looked it was in the /includes/ folder.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Feb 2013, 12:23 AM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: What file or action causes attributes to be added to cart

Duh!!! directly under /includes - - - I was looking in folders

Very little difference between 1.3.9h and 1.5.1

There are no extra_cart_actions files

Zen-Venom Get Bitten