Post by dzman7 » Sat Jul 04, 2015 7:02 am

I am trying to make it so the recurring payment matches the product price, includes the option price and includes the shipping. I tried the following code and it works but I can't figure out how to add the shipping.

Code: Select all

<!-- Created using vQmod XML Generator by UKSB - http://uksb.github.com/vqgen/ //-->
<modification>
	<id><![CDATA[Fixes Recurring Payments to Work as Subscription Service]]></id>
	<version><![CDATA[1.0.0]]></version>
	<vqmver><![CDATA[2.5.1]]></vqmver>
	<author><![CDATA[9etup LLC/ Dustin Zak]]></author>
	<file path="/system/library/" name="cart.php">
		<operation info="This mod will make the recurring price match the product price (used in cart.php), and include option price">
			<search position="replace" offset="7" index="1"><![CDATA[if ($recurring_query->num_rows) {]]></search>
			<add><![CDATA[if ($recurring_query->num_rows) {
	$recurring = array(
		'recurring_id'    => $recurring_id,
		'name'            => $recurring_query->row['name'],
		'frequency'       => $recurring_query->row['frequency'],
		'price'           => $price + $option_price,
		'cycle'           => $recurring_query->row['cycle'],]]></add>
		</operation>
	</file>
</modification>
If I try adding getQuote() it doesn't work (error below) because the shipping method hasn't been selected and won't work until checkout

Code: Select all

<!-- Created using vQmod XML Generator by UKSB - http://uksb.github.com/vqgen/ //-->
<modification>
	<id><![CDATA[Fixes Recurring Payments to Work as Subscription Service]]></id>
	<version><![CDATA[1.0.0]]></version>
	<vqmver><![CDATA[2.5.1]]></vqmver>
	<author><![CDATA[9etup LLC/ Dustin Zak]]></author>
	<file path="/system/library/" name="cart.php">
		<operation info="This mod will make the recurring price match the product price (used in cart.php), and include option price">
			<search position="replace" offset="7" index="1"><![CDATA[if ($recurring_query->num_rows) {]]></search>
			<add><![CDATA[if ($recurring_query->num_rows) {
	$recurring = array(
		'recurring_id'    => $recurring_id,
		'name'            => $recurring_query->row['name'],
		'frequency'       => $recurring_query->row['frequency'],
		'price'           => $price + $option_price + getQuote(),
		'cycle'           => $recurring_query->row['cycle'],]]></add>
		</operation>
	</file>
</modification>

Code: Select all

Fatal error: Call to undefined function getQuote() in /home5/anothey5/public_html/manmail/vqmod/vqcache/vq2-system_library_cart.php on line 229
not sure how to resolve this any help would be much appreciated

Newbie

Posts

Joined
Tue Nov 18, 2014 2:01 am

Post by artcore » Sat Jul 04, 2015 3:42 pm

getQuote() is not a function of the cart.php class so you can't call it from there.

I can't give you an easy fix for the above, as there's a lot involved, but if you want recurring costs to be calculated on the order totals (plus some other extras) you might want to check out this extension (not free!):

http://www.opencart.com/index.php?route ... n_id=22687

Demo for a product with options: http://demo.ilithemes.com/oc2031/index. ... duct_id=54

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands
Who is online

Users browsing this forum: No registered users and 31 guests