Forums / Templates, Stylesheets, Page Layout / shopping cart display

shopping cart display

Views: 1,047

Results 1 to 7 of 7
6 Jan 2013, 9:58 PM
#1
mhawkins avatar

mhawkins

New Zenner

Join Date:
Jun 2009
Location:
Lynnwood, WA, USA
Posts:
40
Plugin Contributions:
0

shopping cart display

I am trying to add the products weight and free shipping(if is free shipping) to shopping cart page. In the box beneath the products name and price and before the attributes listings. I am using zencart 1.51.
I need help with how to get the weight and if free shipping to show properly in the shopping cart page, tpl_shopping_cart_deafult file. I either get everything listed as free shipping or nothing listed as free shipping. I also have not been able to get the weight to appear at all. I have tried adding coding to modules page header which did not seem to help. Any suggestions of what to try next would be greatly appreciated.
What I am trying to get is the product name, cost, weight and free shipping then the attributes broken down with cost and weight to show under each product.
Sample of what I am trying to achieve:

Doctor Decorative Throw
[click to edit]

Decorative Throw - $51.99
[Free Shipping] - [ lbs.]
Additional Matching Items
•Tote Bag - [$35.00][2 lbs.]
Throw Personalization
•Dr. Lana Smith - [$0.00][0 lbs.]
Tote Bag Personalization
•Dr. Lana Smith - [$0.00][0 lbs.]

Grapes Stained Glass Panel
Grapes Stained Glass Panel - $102.95
[Free Shipping] - [ lbs.]

The 2nd item is not free shipping.
I also have not taken the time to work on getting the Calulated Charges for the text to work yet.
Please help with suggestions on how to proceed.
Thanks

7 Jan 2013, 12:17 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: shopping cart display

On the product_info Attributes already will show if there is weight on them ...

What are you trying to do that is different from how it already works by default? :lookaroun

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

7 Jan 2013, 12:25 AM
#3
mhawkins avatar

mhawkins

New Zenner

Join Date:
Jun 2009
Location:
Lynnwood, WA, USA
Posts:
40
Plugin Contributions:
0

Re: shopping cart display

I am adding the base weight and price of the item. The attributes weight and price(except for the text price total) I programmed to show for each attribute. I am having trouble with getting the products weight to show.

7 Jan 2013, 12:44 AM
#4
mhawkins avatar

mhawkins

New Zenner

Join Date:
Jun 2009
Location:
Lynnwood, WA, USA
Posts:
40
Plugin Contributions:
0

Re: shopping cart display

Re: shopping cart display
On the product_info Attributes already will show if there is weight on them ...

What are you trying to do that is different from how it already works by default?

I did not catch that you said product info page. I am trying to edit the shopping cart page in the cart box with a breakdown of the item(s) they are purchasing. The item, price,weight,free shipping if applicable,attributes and their price & weight.

7 Jan 2013, 1:21 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: shopping cart display

You could customize the files:
/includes/modules/pages/shopping_cart/header_php.php

      $attributes = "SELECT popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.attributes_discounted, pa.products_attributes_id, pa.products_attributes_weight_prefix, pa.products_attributes_weight
// bof: show attribute price in cart
      if ($attributes_values->fields['attributes_discounted'] == 1) {
        // apply product discount to attributes if discount is on
        //              $new_attributes_price = $products_options->fields['options_values_price'];
        $new_attributes_price = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, '', 'false');
        $new_attributes_price = zen_get_discount_calc((int)$products[$i]['id'], true, $new_attributes_price);
      } else {
        // discount is off do not apply
        $new_attributes_price = $attributes_values->fields['options_values_price'];
      }
      $attrArray[$option]['new_attributes_price'] = $new_attributes_price;
      $attrArray[$option]['products_attributes_weight_prefix'] = $attributes_values->fields['products_attributes_weight_prefix'];
      $attrArray[$option]['products_attributes_weight'] = $attributes_values->fields['products_attributes_weight'];
// eof: show attribute price in cart

/includes/templates/your_templates_dir/templates/tpl_shopping_cart_default.php

with:

<!-- ORIGINAL <li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li> -->
<li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']) . ' [ ' . $value['price_prefix'] . $currencies->format($value['options_values_price']) . ' ] ' . $currencies->format($value['new_attributes_price'])  . ($value['products_attributes_weight'] > 0 ? ' [ ' . $value['products_attributes_weight_prefix'] . $value['products_attributes_weight'] . 'lbs ] ' : ''); ?></li>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

7 Jan 2013, 4:58 PM
#6
mhawkins avatar

mhawkins

New Zenner

Join Date:
Jun 2009
Location:
Lynnwood, WA, USA
Posts:
40
Plugin Contributions:
0

Re: shopping cart display

I already have those values(except for the combined text charge-calculated letters charges). I am looking for the product (not attribute) weight and if item is listed as free shipping.

7 Jan 2013, 10:38 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: shopping cart display

A quick way to get something from the tables:
products
produces_description

is to use the function zen_products_lookup ...

On the shopping_cart template, you could use:
zen_products_lookup($product['id'], 'products_weight')

to obtain the Product weight without the Attribute weight includes ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!