Jump to content
  • 0

How Is Coupon Sql Worked Out


Question

Posted

Hi there, my site heavily relies on coupons and i am trying to work it out..

i see the 3 tables

"coupons", "coupons_amounts" & "coupons_packages"

 

the coupons packages is my problem..

i have inserted a coupon to the database with the last product in my database.

"46"

it also has the pricing_id for the url is 133.

 

but on the pricing_table.package_id it is 47.

but if i do product 1 it is 1 as the product.

how does this all work?? as i may have multiple coupons for the same product at different amounts..

hopefully someone understands what im trying to say.

 

Cheers,

Ryan.

8 answers to this question

Recommended Posts

  • 0
Posted

Just worked it out i think..

 

here is what i have put it too...

if it has the option for monthly, quaterly or yearly. (as far as i can tell because my product id for '1' is only a single item for 1 month)

it stays the number.

if it has any payment options it has id+1.

 

i've just put that in my script to see what happened and 3 of them have worked so far..

 

by all means michael, check it out (buydedi.com) let me know what you think.. down the bottom "haggle"

  • 0
Posted

Package pricing ID values really have nothing to do with package IDs.

 

Everytime a package is created one or more package pricing options are created as well. Package pricings are stored in the package_pricing table. Don't rely on package pricing IDs being functionally determined by package ID.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...