Post by leprimo » Mon Nov 16, 2009 6:38 pm

I can pay via paypal and need the following query. I'll try to explain.
When a product has several option values like this T-Shirt-Size:
Product: T-Shirt
  • Price: 10€
    Option: Size
    XS -3€
    S,M,L,XL,XXL normal price 10€
    3XL,4XL +3€
    5XL +5€
I need the lowest price of the product (7€) to show him in the product page like:
Price: From... 7,00€.
In the product overview, we want the customer tell, that there is a price from 7€ to n and not only one price.
Therefore I need a query in the catalog/model/product.php that can do this.
I'm too stupid to do it for myself.

Active Member

Posts

Joined
Wed Nov 04, 2009 8:31 pm

Post by Qphoria » Mon Nov 16, 2009 9:51 pm

This is really very easy if you use options correctly.

Options were designed to "add" to the base price.

I've created a demo for this:
http://unbannable.com/v132/index.php?ro ... duct_id=49

Set your "smallest size" to the base
Set your first option to the default size and make it 0.00. That implies that this is the default size.

Product 1: 7.00
Option 1: Small
Option 2: Med (+4.00)
Option 3: Large (+5.00)
Option 4: XL (+6.00)

Then all you need to do is add the words "Priced from:" in front of each price.

No custom queries or anything like that.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by leprimo » Tue Nov 17, 2009 5:55 pm

Didn't I tell you before? :-[
I'm too stupid ...
The straight tip was
Qphoria wrote: Set your "smallest size" to the base...
Thank you!

Active Member

Posts

Joined
Wed Nov 04, 2009 8:31 pm

Post by jc-piazza » Tue Nov 24, 2009 10:31 am

here's the error I get when I follow the instructions...must be doing something wrong.

Error: Unknown column 'quantity' in 'field list'
Error No: 1054
INSERT INTO product_option_value SET product_option_id = '63', product_id = '55', quantity = '12', subtract = '0', price = '0', prefix = '-', sort_order = '1'

New member

Posts

Joined
Mon Sep 07, 2009 3:23 am

Post by Qphoria » Tue Nov 24, 2009 1:29 pm

Looks like you upgraded and missed a step somewhere. Or is this a fresh install?

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Leon » Sun Dec 06, 2009 2:54 am

I just got this error when i was trying to modify products that had product options.

They didn't miss steps, Daniel forgot to add them to the instructions.

The fix:
-- STEP 1: BACKUP EXISTING DATABASE & FILES
-- STEP 2: Do a Find/replace in this file to replace 'xxx_' with your prefix.
-- If you don't have a prefix, then find/replace 'xxx_' with a blank
-- STEP 3: Execute the following code in phpmyadmin sql window:
ALTER TABLE `xxx_product_option_value` ADD COLUMN `quantity` int(4) NOT NULL DEFAULT '0' AFTER `product_id`;
ALTER TABLE `xxx_product_option_value` ADD COLUMN `subtract` int(1) NOT NULL DEFAULT '0' AFTER `quantity`;

All credit for this fix goes to Qphoria, this is just a copy/paste from his upgrade instructions 1.3.2 to 1.3.4.

Thanks Qphoria

Active Member

Posts

Joined
Tue Apr 07, 2009 1:20 am
Who is online

Users browsing this forum: paulfeakins and 11 guests