Post by Qphoria » Sat Jan 21, 2012 2:56 am

So the way OpenCart implements product options is meant to "complement" the base price. So the option price adds to the base price and by default it expects a setup like this:

Code: Select all

Product: Perfume $10.00
   Size:
       - 25ml
       - 50ml (+10.00)
       - 100ml (+20.00)
This implies that the base price of 10.00 is the price for the 25ml perfume

Essentially the same as this:

Code: Select all

Product: Perfume $0.00
   Size:
       - 25ml (10.00)
       - 50ml (20.00)
       - 100ml (30.00)
However with that setup, All category, module, etc pages will show the product price as 0.00 on all listings and modules which is not desired.

But for those people who want to price by option feature similar to Zencart, this script will grab all the option prices and grab the lowest price for the displayed main price.

The price for this product below is set to 0.00
The lowest option price is 14.00
It shows the lowest option price as the main price on module and non-product pages


Category/Module Pages:
Image

For product pages, I've altered this slightly to add "Starting at:" to the beginning

Product Page:
Image

NOTE: There was some complexity to this method to support Options Price Update Redux. The product page uses a different method than the other pages for the price. To avoid doubling the price when using Option Price Update Redux, I use the currency library to fake the price. This allows options price update redux to work. It also offers the ability to add a message to the price on the product page like "Starting At $x.xx". This cannot be added on other pages with this mod alone.

Here's a video of how it works with the Options Price Update Redux mod:
http://screencast.com/t/uEwFeLXqErH

Attachments

1.5.0.x - 1.5.2.x


Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by d7a7z7e7d » Sat Jan 21, 2012 3:27 am

Awesome work, I know of a few people that will find this very useful. Thanks!

Image
OpenCart Extensions, Technical Support & Custom Development | Have I helped you?


User avatar
Active Member

Posts

Joined
Fri Sep 17, 2010 5:51 am
Location - USA

Post by resonanz » Wed Feb 08, 2012 7:34 pm

Thanks a heap for this - it works for me. Very much appreciated.

Newbie

Posts

Joined
Sun Feb 05, 2012 11:58 am

Post by Out2lunch » Wed Feb 15, 2012 11:11 pm

This is an awsome mod, but it doesnt work quite correctly for me, is there any way to change it slightly.

The problem I have is that it sets the Price ex-tax as the main price, and the box underneath price which is ex-tax is set to $0.00

Ie is should be Starting From - £215 - which is inc vat for the UK, and the Ex-Tax should say £215

See the screen shot to see what I mean.


Image

I would be very happy to give you something for your time if you can mod this.

New member

Posts

Joined
Wed Jun 29, 2011 9:32 pm

Post by Qphoria » Thu Feb 16, 2012 1:01 am

Oh you silly "always show tax" countries ;D
I'll see about adding support for the tax fields

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Cookie1974 » Wed Feb 22, 2012 12:08 am

Hi,

I am using this xml along with your Option Price Update Redux and it all work perfectly except that on each product page the default price showing is the lowest price from the product_id beforehand.

I'm on 1.5.1.3. vMod installed (with no other vmods to interfere with product pricing).

I'm pretty sure that the issue is with this xml not the Option Price Update Redux, as when I remove price_by_options.xml my default price goes back to £0.00 as I understand I should do.

FYI, I'm using this template: http://themeforest.net/item/photocart-p ... or=Temakoo

Please can you help as this is the only issue I am having with an otherwise excellent mod!! ???

Newbie

Posts

Joined
Tue Nov 29, 2011 6:25 pm

Post by Out2lunch » Fri Feb 24, 2012 6:24 pm

Sorry to push you on this, have you had any luck with this, as we want to turn our site live, and this is one of the final polishes needed.

As I said before im happy to give you something for completing this bit of code.

New member

Posts

Joined
Wed Jun 29, 2011 9:32 pm

Post by Qphoria » Fri Feb 24, 2012 11:58 pm

Updated version in first post
- Fixed options price update compatibility
- Fixed Price and Price Ex tax display
- Fixed error for products with no options

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Out2lunch » Sat Feb 25, 2012 12:52 am

Thank you Sir, it works perfectly...

Have a pint on me, donation made.

For a possible update, and another Pint, how easy would it be for the mod to update price on the product page once something was selected? Only a thought...


Thanks again.

New member

Posts

Joined
Wed Jun 29, 2011 9:32 pm

Post by Qphoria » Sat Feb 25, 2012 3:02 am

Out2lunch wrote:Thank you Sir, it works perfectly...

Have a pint on me, donation made.

For a possible update, and another Pint, how easy would it be for the mod to update price on the product page once something was selected? Only a thought...


Thanks again.
You can use my options price update for that:
http://www.opencart.com/index.php?route ... on_id=1458

I've made it specifically compatible with that mod.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Sat Mar 03, 2012 1:12 am

Updated first post
- Fixed issue where if you had non-pricebased options in addition to the price based options, it would show 0.00 for the price.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Sun Mar 04, 2012 4:13 am

tv_kade wrote:hi.this is show the lowest price for the price.
but i want show maximum price for the price
is this possible?
Yes. easy

1. EDIT: price_by_options.xml

2. FIND:
sort

3. REPLACE WITH
rsort

You may want to also change the "Starting At"
with something else as well.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by wroughtec » Sun Mar 04, 2012 6:52 pm

out of curiosity how would this affect product feeds?

Will say google see 0.00 or will they see the lowest price?

Also is there a way of setting it so the lowest priced item is the default rather than 'please select' (in a dropdown say) as if you do select please select the price display 0.00

New member

Posts

Joined
Sat Feb 18, 2012 7:45 am

Post by Qphoria » Mon Mar 05, 2012 1:31 pm

wroughtec wrote:out of curiosity how would this affect product feeds?

Will say google see 0.00 or will they see the lowest price?

Also is there a way of setting it so the lowest priced item is the default rather than 'please select' (in a dropdown say) as if you do select please select the price display 0.00
They will see lowest price in rss feeds

Setting default options is beyond the scope of this mod. There are plans to add a "default" box to options so that they can be set by default in another mod

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by tophat » Wed Mar 07, 2012 8:56 pm

Thanks for this and also bought the module which is working all good.

Due to the way my page is styled, on other pages where it shows related products, the price appearing there has the full text of 'starting at £239' and unfortunately spills off the edge as there is no space.

Simple fix is to remove the pretext. Question I have would be to what line I delete?

Or, can this mod be altered to not show the 'starting at' text in this area of the website as I like it showing on the product itself.

Thanks,

[EDIT] - It now appears that some related products are showing a price of zero! A fix would be greatly appreciated.

Webmaster for: http://www.getlaidbeds.co.uk + www.mattressmoose.co.uk + www.pixellounge.co.uk


User avatar
Active Member

Posts

Joined
Fri Nov 25, 2011 8:31 am


Post by Qphoria » Thu Mar 08, 2012 5:30 am

It is technically supposed to only show on the product page... i noticed that related products tend to get it too but not fully sure why... when I looked at it last I was tired so I'll take another look

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by tophat » Thu Mar 08, 2012 7:54 am

Qphoria wrote:It is technically supposed to only show on the product page... i noticed that related products tend to get it too but not fully sure why... when I looked at it last I was tired so I'll take another look
hey no worries! get some sleep ;)

Webmaster for: http://www.getlaidbeds.co.uk + www.mattressmoose.co.uk + www.pixellounge.co.uk


User avatar
Active Member

Posts

Joined
Fri Nov 25, 2011 8:31 am


Post by angad » Fri Mar 09, 2012 8:09 am

Hi There,
This is great works very nicely on the test site I have set-up.
I have a client who wants to integrate ecommerce into joomla site and am thinking of switching to using ayelshop/aceshop which merges in opencart but is a totally new thing to me at the moment - just learning - do you know if this mod will work on with ayelshop (plus your option price redux MOD) too as this would be esential for my client...

Also another question - in your screen shot in 1st post the option price is show without the (+) symbol...How do I achieve that?
Thanks
Angad

----- keep up -----


Newbie

Posts

Joined
Fri Mar 09, 2012 8:02 am
Location - Brighton, UK

Post by Qphoria » Fri Mar 09, 2012 9:46 am

Yes it will work with Ayelshop as I recently made some changes to support it

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Quentin100 » Fri Mar 09, 2012 5:16 pm

Hi Qphoria,

Really useful bit of code as so often this is what the customer wants! I have one small issue, the prices in extra modules I have added (namely Shopping cart in side column and scrolling related products) show the main price (which is set at 0.00) and not the lowest priced option.

I'm still learning php as i go so although I can hack a few things, I can't work out why it isn't updating the prices in these two modules. Any help or pointers in the right direction would be greatly appreciated.

Thanks,

Quentin

Newbie

Posts

Joined
Fri Feb 10, 2012 11:19 pm
Who is online

Users browsing this forum: No registered users and 58 guests