Post by DeanANTB » Sat Nov 09, 2019 12:38 am

Hi,

I'm trying to modify an extension which adds an equals sign as one of the possibilities for option value. This works fine with the regular price, but the special price messes it up. The developer hasn't been around for pretty much a year.

Here is the code it uses for calculating the price (it edits system/library/cart/cart.php):

Code: Select all

$option_price += $option_value_query->row['price'] - $product_query->row['price']
I've tried replacing $product_query->row['price'] with $product_special_query->row['price'] but that doesn't work.

Essentially, I just need some code which will output the value of the special price (100% of products will have a special price, so it doesn't need to do anything fancy like check if it's cheaper or anything like that - just outputting the value of the special price will do.

If anyone can help, that would be great.

Running on 3.0.3.2.

Newbie

Posts

Joined
Tue Jul 16, 2019 5:17 pm

Post by cyclops12 » Sat Nov 09, 2019 2:14 am

DeanANTB wrote:
Sat Nov 09, 2019 12:38 am
Hi,

I'm trying to modify an extension
This works fine with the regular price, but the special price messes it up. 100% of products will have a special price
Then why do you need a special price?

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by thekrotek » Sat Nov 09, 2019 2:43 am

cyclops12 wrote:
Sat Nov 09, 2019 2:14 am
Then why do you need a special price?
Fake discounting technique. A pretty common thingie.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by cyclops12 » Sat Nov 09, 2019 3:13 am

thekrotek wrote:
Sat Nov 09, 2019 2:43 am
cyclops12 wrote:
Sat Nov 09, 2019 2:14 am
Then why do you need a special price?
Fake discounting technique. A pretty common thingie.
Ah I see

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by letxobnav » Sat Nov 09, 2019 4:26 pm

This works fine with the regular price, but the special price messes it up.
Not sure what you are trying but the option price is added or subtracted from the final product price whether that is a regular price, discounted price or a special price.

If "=" should mean no addition or subtraction, then simply set the option price to zero.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by DeanANTB » Mon Nov 11, 2019 11:26 pm

cyclops12 wrote:
Sat Nov 09, 2019 2:14 am
Then why do you need a special price?
To show the discount from the product's official RRP.
letxobnav wrote:
Sat Nov 09, 2019 4:26 pm
Not sure what you are trying but the option price is added or subtracted from the final product price whether that is a regular price, discounted price or a special price.

If "=" should mean no addition or subtraction, then simply set the option price to zero.
The = allows for a value of options. It changes the base price to what the equals price is set to. We have products of different sizes and get price lists in sizes - so using + means a lot of working out.

The way this extension does it is to work out the difference between the regular price and the "=" price and adds that to the price.

Newbie

Posts

Joined
Tue Jul 16, 2019 5:17 pm
Who is online

Users browsing this forum: No registered users and 9 guests