Post by giancarlo64 » Wed Jan 31, 2018 8:29 pm

Hi,
I have OC 3.0.2.0 and I have a product that is sold in different length. Every length as of course is own price. I created an option with different length but in the product for every length I can only give the price difference to the "basic" product. I would that there is no basic price but every length has his own full price. Is it possible? I found a module that do this (viewtopic.php?t=68083) bit is not for OC 3. Do someone know another solution or module?

Thanks

Gian Carlo

New member

Posts

Joined
Tue Jun 27, 2017 6:30 pm

Post by cyclops12 » Thu Feb 01, 2018 1:35 am

Have you tried asking the author of the mod if they will update it to make it compatible with the latest version of oc?

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by giancarlo64 » Sat Feb 03, 2018 5:35 am

I have tried with this code but it doesn't seem to work

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <id>Show Full Option Price</id>
    <code>001</code>
	<name>Show Full Option Price</name>
	<version>0.5</version>
    <vqmver>2.6.3</vqmver>
	<file name="catalog/controller/product/product.php">
        <operation info="3.x" error="skip">
			<search position="after"><![CDATA[
			foreach ($option['product_option_value'] as $option_value) {
			]]></search>
			<add><![CDATA[
			if ($option_value['price_prefix'] == '-') {
				$option_value['price'] = (($product_info['special'] ? ($product_info['special'] - $option_value['price']) : ($product_info['price']) - $option_value['price']));
			} elseif ($option_value['price_prefix'] == '+') {
				$option_value['price'] = (($product_info['special'] ? ($product_info['special'] + $option_value['price']) : ($product_info['price']) + $option_value['price']));
			}
			$option_value['price_prefix'] = '';
			]]></add>
		</operation>
	</file>
</modification>
Any help?

Thanks

Gian Carlo
Last edited by straightlight on Thu Mar 12, 2020 12:48 am, edited 1 time in total.
Reason: Added code tags.

New member

Posts

Joined
Tue Jun 27, 2017 6:30 pm

Post by cyclops12 » Sat Feb 03, 2018 6:17 pm

Well i just tried Q's code in a default clean 3020 version and it works, try this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
	<id>Show Full Option Price</id>
	<version>200.1</version>
	<vqmver>2.5.1</vqmver>
	<author>Qphoria</author>
	<file name="catalog/controller/product/product.php">		
		<operation info="3.x" error="log">
			<search position="after"><![CDATA[
			foreach ($option['product_option_value'] as $option_value) {
			]]></search>
			<add><![CDATA[
			if ($option_value['price_prefix'] == '-') {
				$option_value['price'] = (($product_info['special'] ? ($product_info['special'] - $option_value['price']) : ($product_info['price']) - $option_value['price']));
			} elseif ($option_value['price_prefix'] == '+') {
				$option_value['price'] = (($product_info['special'] ? ($product_info['special'] + $option_value['price']) : ($product_info['price']) + $option_value['price']));
			}
			$option_value['price_prefix'] = '';
			]]></add>
		</operation>
	</file>
</modification>

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by giancarlo64 » Sat Feb 03, 2018 8:26 pm

Hi cyclops12,
I have tried to add your code but without success.
In your code I had to add following lines if not the editor give me an error:

Code: Select all

<code>001</code>
<name>Show Full Option Price</name>
I have also installed

Modification Manager 3.0.4
vqmod 2.6.3

I have no errors in the logs
But still I can't get the full price

Gian Carlo
Last edited by straightlight on Thu Mar 12, 2020 12:48 am, edited 1 time in total.
Reason: Added code tags.

New member

Posts

Joined
Tue Jun 27, 2017 6:30 pm

Post by giancarlo64 » Sat Feb 03, 2018 9:21 pm

If I add directly the code in the product.php it works ....

New member

Posts

Joined
Tue Jun 27, 2017 6:30 pm

Post by cyclops12 » Sat Feb 03, 2018 9:43 pm

I am using vqmod 2.6.3, vqmod manager 3.2.0 in a fresh oc 3.0.2.0
Attached is the vqmod from Qphoria which works for me.
Unless you have another mod/extension that is interfering with the code then i cant see why it doesnt work for you

Attachments


Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by giancarlo64 » Mon Feb 05, 2018 2:49 pm

Hi cyclops12,
I have installed all from scratch and now is working. :-)
Thank's

Gian Carlo

New member

Posts

Joined
Tue Jun 27, 2017 6:30 pm
Who is online

Users browsing this forum: Semrush [Bot] and 134 guests