If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Customization from the Admin / Shipping Customization Per Product

Shipping Customization Per Product

Started by jsarwar on 20 Jan 2015, 8:31 AM · Views: 5,050

Results 1 to 14 of 14
20 Jan 2015, 8:31 AM
#1
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Shipping Customization Per Product

Hi,

One client site offer free shipping on all items but they offering some add on items with low prices and don't want to offer free shipping on those so how I can exclude these 3- 5 items from free shipping?

Note: Free Shipper is off. Free Shipping Option is on to offer sitewide free shipping. Looking to exclude these add on items from Free Shipping Option.

Building another client site where they will be have fixed price and auction listings. They do want to offer free shipping on fixed price (Product General) but not on auction listings (Product auction). Is there a way to exclude Free Shipping Option by product type?

Thank you!

20 Jan 2015, 5:16 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Shipping Customization Per Product

What version of Zen Cart are you using?

What method of shipping or module do you want to offer when the shipping is not free?

Are these products that you want to offer that need to charge shipping not free to everyone?

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!

20 Jan 2015, 5:59 PM
#3
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Shipping Customization Per Product

ZC 1.5.3

Shipping methods:
When no Free Shipping then customer may choose from USPS and UPS.

Products with no free shipping, charge shipping to everyone. May need customization down the road so if you can share how to exclude one customer group that would be great.

Thank you!

20 Jan 2015, 6:19 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Shipping Customization Per Product

What is already built in is to mark all products that are Free Shipping as:

Always Free Shipping: **Yes, Always Free Shipping **

Then remove the Free Shipping Options freeoptions and install the FREE SHIPPING! freeshipper and on Products that require shipping, then mark as:

Always Free Shipping: No, Normal Shipping Rules

and set the Product Weight ...

Now if there is weight in the Order, you will see the UPS and USPS shipping modules and if the Order is 0 weight you will see the FREE SHIPPING! shipping module ...

To set all of the Products to be Always Free Shipping you can use:

UPDATE products SET product_is_always_free_shipping = 1;

in the Tools ... Install SQL Patches ...

Then, just edit any Products you might have already added that needs shipping costs and utilize the Always Free Shipping settings for future Products ...

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!

20 Jan 2015, 6:33 PM
#5
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Shipping Customization Per Product

Ajeh:

What is already built in is to mark all products that are Free Shipping as:

Then remove the Free Shipping Options freeoptions and install the FREE SHIPPING! freeshipper and on Products that require shipping, then mark as:

and set the Product Weight ...

Now if there is weight in the Order, you will see the UPS and USPS shipping modules and if the Order is 0 weight you will see the FREE SHIPPING! shipping module ...

To set all of the Products to be Always Free Shipping you can use:

UPDATE products SET product_is_always_free_shipping = 1;

> 
> in the Tools ... Install SQL Patches ...
> 
> Then, just edit any Products you might have already added that needs shipping costs and utilize the Always Free Shipping settings for future Products ...

Thank you! I read somewhere in past about adding product/category ids to exempt from certain shipping service. Do you know how to do that as its only 3 - 5 products and 1 category for auctions so instead of switching all 7k products it would be easy to just do 1 category and 3 - 5 products. 


Also how can do a shipping service only for 1 group of customer?
20 Jan 2015, 6:42 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Shipping Customization Per Product

Aren't the Products in the 1 Category added in some manner like regular Products either manually or as an import where the Always Free Shipping can be set from the git go so that you can use the built in Free Shipping without having to touch code?

You can also update the Products to Always Free Shipping based on the master_categories_id value so if the master_categories_id is 33, then use:

UPDATE products SET product_is_always_free_shipping = 1 WHERE master_categories_id =33;

As to limiting based on Customer Group, you could make a Customer Group and then incorporate that into the code for the managing shipping, but it would help to see the site, some of the Products that should be Free Shipping or should have a charge and then look at how the Customer Group might influence the shipping ...

More or less, more details and specifics the better ...

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!

19 Sep 2020, 11:35 AM
#7
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Shipping Customization Per Product

Is it possible to add minimum $ amount for free shipping for *Always Free Shipping: ***Yes, Always Free Shipping shipping method? **This is the only product page control shipping method but does not have order total minimum condition and would like to add it.

19 Sep 2020, 12:33 PM
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Shipping Customization Per Product

jsarwar:

Is it possible to add minimum $ amount for free shipping for *Always Free Shipping: ***Yes, Always Free Shipping shipping method? **This is the only product page control shipping method but does not have order total minimum condition and would like to add it.
In what way does the ***freeoptions ***shipping method (that includes such a control) not work for you?

19 Sep 2020, 12:53 PM
#9
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Shipping Customization Per Product

lat9:

In what way does the ***freeoptions ***shipping method (that includes such a control) not work for you?

Website does not offer free shipping but only on some products where this control Always Free shipping is marked yes on product page but need a control "order minimum amount" so customer spend certain amount to get free shipping on such products.

19 Sep 2020, 1:22 PM
#10
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Shipping Customization Per Product

Thanks for the clarification, @jsarwar. That change would require some custom coding.

19 Sep 2020, 11:01 PM
#11
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Shipping Customization Per Product

Can you shed some light which files need to edit and how. I edit this module file with if clause order total but it did not work.

20 Sep 2020, 11:24 AM
#12
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Shipping Customization Per Product

You'll need to find a way, whether a separate field in the database or a simple PHP look-up table, to associate the minimum-order amount for free shipping on a product-by-product basis.

26 Sep 2020, 11:25 AM
#13
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Shipping Customization Per Product

I know how to create a switch/field on product page but not sure how to implement it on catalog side. Can you shed some light which files need to edit and how for catalog side?

lat9:

You'll need to find a way, whether a separate field in the database or a simple PHP look-up table, to associate the minimum-order amount for free shipping on a product-by-product basis.

27 Sep 2020, 4:19 PM
#14
drbyte avatar

drbyte

Sensei

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

Re: Shipping Customization Per Product

The logic for granting free shipping on products marked "always free shipping" happens in a couple places. Which one takes effect depends on which shipping module/s you have enabled in your store.

Sometimes the shipping module itself does all the calculations on its own.
Often it simply relies on the "weight of the entire order", which the shopping_cart class provides after first setting the weight for "always free shipping" products to 0. This effectively makes them "free shipping" because shipping is mostly determined by the weight of the shipment.

So, you'll need to find all the code that checks for the 'product_is_always_free_shipping' flag on each of the products in your cart and converts the weight to 0, and update the code to also check for whether the overall cart total is above the threshold you say you want to impose.
Inside the shopping_cart class that total is represented in $this->total. Outside the class it's in $_SESSION['cart']->total instead.

As a sanity check later in your code you can check these values to see if your code adjustments make sense:
$_SESSION['cart']->free_shipping_weight (weight of all items granted free shipping)
$_SESSION['cart']->free_shipping_item (number of items granted free shipping)
$_SESSION['cart']->weight (weight of non-free-shipping items)

Remember, the shopping_cart class treats the following as free-shipping (by setting the weight for these items to 0):

  • product has 'product_is_always_free_shipping' set to 1
  • downloads
  • purchase of gift certificates
  • weight is 0 (either directly, or via attribute rules selected for that product)

.
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.