Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need to remove shipping if a certain attribute is chosen


lindsayanng

Recommended Posts

So I have my store set up in a way that the attributes are actually the products and the product itself can't be purchased without an attribute. see here: My link

 

What is happening is, thgere is a weight associated with the product itself because we also have gift vouchers which need a weight of 0 to remove the shipping.. So is there a way to apply weights to the attributes? I have heavily modified attributes so i'm looking for some code exambles maybe so i can hopefully work it into the code myself.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

So I have my store set up in a way that the attributes are actually the products and the product itself can't be purchased without an attribute. see here: My link

 

What is happening is, thgere is a weight associated with the product itself because we also have gift vouchers which need a weight of 0 to remove the shipping.. So is there a way to apply weights to the attributes? I have heavily modified attributes so i'm looking for some code exambles maybe so i can hopefully work it into the code myself.

 

 

Well without getting into the code (because I'm not at home right now), it should be a doable thing. What comes to mind is adding another field to products_attributes for the weight. Then either give it a default of NULL and program it to use product weight if null, or write a script to autopopulate the attribute's weight with the parent product's weight and then manually change weights of attributes after this.

 

You will have to change your queries and order total calculations. I remember you asked about a giftwrap/expedite shipping issue before... you would approach this the same way in terms of the order total calculation.

 

EDIT:

Or if you simply want to remove the product's weight if a specific attribute is selected, this would be easy. In your order total calculation, just do something like (very psuedo-code):

if (product_attribute == "whatever") { product_weight = 0; }

Sorry I'm not at home so I can't give you real code now...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...