Coupon Code -Checkout- Open Cart

I’m not sure how common Open Cart problems are on these forums, but I have one. I’m trying to add the coupon entry box onto the payment method area on the checkout screen. I’m using “vqmod” and “checkout-coupon.xml” I’m getting 3 errors as follows:

[i]Notice: Undefined variable: entry_payment_coupon in /home/guylyman/public_html/vqmod/vqcache/vq2-catalog_view_theme_herbal_template_checkout_payment_method.tpl on line 27

Notice: Undefined variable: text_payment_coupon in /home/guylyman/public_html/vqmod/vqcache/vq2-catalog_view_theme_herbal_template_checkout_payment_method.tpl on line 28

Notice: Undefined variable: button_coupon in /home/guylyman/public_html/vqmod/vqcache/vq2-catalog_view_theme_herbal_template_checkout_payment_method.tpl on line 30[/i]

Here is checkout-coupon.xml

[php]
Opencart core file modifications for adding coupon support into the checkout sequence
1.5.1.1
1.2.3
mhccorp.com

<file name="catalog/controller/checkout/payment.php">
	<operation>
		<search position="after"><![CDATA[$this->data['text_comments'] = $this->language->get('text_comments');]]></search>
		<add><![CDATA[
	$this->data['entry_payment_coupon'] = $this->language->get('entry_payment_coupon');
	$this->data['text_payment_coupon'] = $this->language->get('text_payment_coupon');
	$this->data['text_payment_coupon_success'] = $this->language->get('text_payment_coupon_success');
	$this->data['button_coupon'] = $this->language->get('button_coupon');
		]]></add>
	</operation>
</file>
<file name="catalog/language/english/checkout/checkout.php">
	<operation>
		<search position="after"><![CDATA[$_['text_comments']]]></search>
		<add><![CDATA[

$[‘entry_payment_coupon’] = ‘Enter your code (if available) and click “Apply Coupon”’;
$
[‘text_payment_coupon’] = ‘Discount Coupon Code:’;
$[‘text_payment_coupon_success’] = ‘Your discount coupon has been successfuly applied to your order. You will see it in the next checkout step’;
$
[‘button_coupon’] = ‘Apply Coupon’;
]]>




<![CDATA[
<![CDATA[

<?php echo $entry_payment_coupon; ?>

<?php echo $text_payment_coupon; ?>   <?php echo $button_coupon; ?>

]]> <![CDATA[ ]]>

[/php]

Here is vq2-catalog_view_theme_herbal_template_checkout_payment_method.tpl

[php]<?php
// Heading
$_[‘heading_title’] = ‘Checkout’;

// Text
$[‘text_cart’] = ‘Shopping Cart’;
$
[‘text_checkout_option’] = ‘Step 1: Checkout Options’;
$[‘text_checkout_account’] = ‘Account & Billing Details’;
$
[‘text_checkout_payment_address’] = ‘Billing Details’;
$[‘text_checkout_shipping_address’] = ‘Delivery Details’;
$
[‘text_checkout_shipping_method’] = ‘Delivery Method’;
$[‘text_checkout_payment_method’] = ‘Payment Method’;
$
[‘text_checkout_confirm’] = ‘Confirm Order’;
$[‘text_modify’] = ‘Modify »’;
$
[‘text_new_customer’] = ‘New Customer’;
$[‘text_returning_customer’] = ‘Returning Customer’;
$
[‘text_checkout’] = ‘Checkout Options:’;
$[‘text_i_am_returning_customer’] = ‘I am a returning customer’;
$
[‘text_register’] = ‘Register Account’;
$[‘text_guest’] = ‘Guest Checkout’;
$
[‘text_register_account’] = ‘By creating an account you will be able to shop faster, be up to date on an order’s status, and keep track of the orders you have previously made.’;
$[‘text_forgotten’] = ‘Forgotten Password’;
$
[‘text_your_details’] = ‘Your Personal Details’;
$[‘text_your_address’] = ‘Your Address’;
$
[‘text_your_password’] = ‘Your Password’;
$[‘text_agree’] = ‘I have read and agree to the %s’;
$
[‘text_address_new’] = ‘I want to use a new address’;
$[‘text_address_existing’] = ‘I want to use an existing address’;
$
[‘text_shipping_method’] = ‘Please select the preferred shipping method to use on this order.’;
$[‘text_payment_method’] = ‘Please select the preferred payment method to use on this order.’;
$
[‘text_comments’] = ‘Add Comments About Your Order’;

$[‘entry_payment_coupon’] = ‘Enter your code (if available) and click “Apply Coupon”’;
$
[‘text_payment_coupon’] = ‘Discount Coupon Code:’;
$[‘text_payment_coupon_success’] = ‘Your discount coupon has been successfuly applied to your order. You will see it in the next checkout step’;
$
[‘button_coupon’] = ‘Apply Coupon’;

// Column
$[‘column_name’] = ‘Product Name’;
$
[‘column_model’] = ‘Model’;
$[‘column_quantity’] = ‘Quantity’;
$
[‘column_price’] = ‘Price’;
$_[‘column_total’] = ‘Total’;

// Entry
$[‘entry_email_address’] = ‘E-Mail Address:’;
$
[‘entry_email’] = ‘E-Mail:’;
$[‘entry_password’] = ‘Password:’;
$
[‘entry_confirm’] = ‘Password Confirm:’;
$[‘entry_firstname’] = ‘First Name:’;
$
[‘entry_lastname’] = ‘Last Name:’;
$[‘entry_telephone’] = ‘Telephone:’;
$
[‘entry_fax’] = ‘Fax:’;
$[‘entry_company’] = ‘Company:’;
$
[‘entry_address_1’] = ‘Address 1:’;
$[‘entry_address_2’] = ‘Address 2:’;
$
[‘entry_postcode’] = ‘Post Code:’;
$[‘entry_city’] = ‘City:’;
$
[‘entry_country’] = ‘Country:’;
$[‘entry_zone’] = ‘Region / State:’;
$
[‘entry_newsletter’] = ‘I wish to subscribe to the %s newsletter.’;
$_[‘entry_shipping’] = ‘My delivery and billing addresses are the same.’;

// Error
$[‘error_warning’] = ‘There was a problem while trying to process your order! If the problem persists please try selecting a different payment method or you can contact the store owner by clicking here.’;
$
[‘error_login’] = ‘Warning: No match for E-Mail Address and/or Password.’;
$[‘error_exists’] = ‘Warning: E-Mail Address is already registered!’;
$
[‘error_firstname’] = ‘First Name must be between 1 and 32 characters!’;
$[‘error_lastname’] = ‘Last Name must be between 1 and 32 characters!’;
$
[‘error_email’] = ‘E-Mail Address does not appear to be valid!’;
$[‘error_telephone’] = ‘Telephone must be between 3 and 32 characters!’;
$
[‘error_password’] = ‘Password must be between 3 and 20 characters!’;
$[‘error_confirm’] = ‘Password confirmation does not match password!’;
$
[‘error_address_1’] = ‘Address 1 must be between 3 and 128 characters!’;
$[‘error_city’] = ‘City must be between 2 and 128 characters!’;
$
[‘error_postcode’] = ‘Postcode must be between 2 and 10 characters!’;
$[‘error_country’] = ‘Please select a country!’;
$
[‘error_zone’] = ‘Please select a region / state!’;
$[‘error_agree’] = ‘Warning: You must agree to the %s!’;
$
[‘error_address’] = ‘Warning: You must select address!’;
$[‘error_shipping’] = ‘Warning: Shipping method required!’;
$
[‘error_no_shipping’] = ‘Warning: No Shipping options are available. Please contact us for assistance!’;
$[‘error_payment’] = ‘Warning: Payment method required!’;
$
[‘error_no_payment’] = ‘Warning: No Payment options are available. Please contact us for assistance!’;
?>[/php]

Here is checkout.tpl
[php]<?php
class ControllerCheckoutCheckout extends Controller {
public function index() {
// Validate cart has products and has stock.
if ((!$this->cart->hasProducts() && empty($this->session->data[‘vouchers’])) || (!$this->cart->hasStock() && !$this->config->get(‘config_stock_checkout’))) {
$this->redirect($this->url->link(‘checkout/cart’));
}

	// Validate minimum quantity requirments.			
	$products = $this->cart->getProducts();
			
	foreach ($products as $product) {
		$product_total = 0;
			
		foreach ($products as $product_2) {
			if ($product_2['product_id'] == $product['product_id']) {
				$product_total += $product_2['quantity'];
			}
		}		
		
		if ($product['minimum'] > $product_total) {
			$this->redirect($this->url->link('checkout/cart'));
		}				
	}
			
	$this->language->load('checkout/checkout');
	
	$this->document->setTitle($this->language->get('heading_title')); 
	
	$this->data['breadcrumbs'] = array();

  	$this->data['breadcrumbs'][] = array(
    	'text'      => $this->language->get('text_home'),
		'href'      => $this->url->link('common/home'),
    	'separator' => false
  	); 

  	$this->data['breadcrumbs'][] = array(
    	'text'      => $this->language->get('text_cart'),
		'href'      => $this->url->link('checkout/cart'),
    	'separator' => $this->language->get('text_separator')
  	);
	
  	$this->data['breadcrumbs'][] = array(
    	'text'      => $this->language->get('heading_title'),
		'href'      => $this->url->link('checkout/checkout', '', 'SSL'),
    	'separator' => $this->language->get('text_separator')
  	);
				
    $this->data['heading_title'] = $this->language->get('heading_title');
	
	$this->data['text_checkout_option'] = sprintf($this->language->get('text_checkout_option'));
	$this->data['text_checkout_account'] = $this->language->get('text_checkout_account');
	$this->data['text_checkout_payment_address'] = $this->language->get('text_checkout_payment_address');
	$this->data['text_checkout_shipping_address'] = $this->language->get('text_checkout_shipping_address');
	$this->data['text_checkout_shipping_method'] = $this->language->get('text_checkout_shipping_method');
	$this->data['text_checkout_payment_method'] = $this->language->get('text_checkout_payment_method');		
	$this->data['text_checkout_confirm'] = $this->language->get('text_checkout_confirm');
	$this->data['text_modify'] = $this->language->get('text_modify');
	
	$this->data['logged'] = $this->customer->isLogged();
	$this->data['shipping_required'] = $this->cart->hasShipping();	
	
	if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/checkout/checkout.tpl')) {
		$this->template = $this->config->get('config_template') . '/template/checkout/checkout.tpl';
	} else {
		$this->template = 'default/template/checkout/checkout.tpl';
	}
	
	$this->children = array(
		'common/column_left',
		'common/column_right',
		'common/content_top',
		'common/content_bottom',
		'common/footer',
		'common/header'	
	);
			
	$this->response->setOutput($this->render());
}

}
?>[/php]

I know I’m just coming in here expecting this community to solve my problem, but I can’t find the answer after several days of seeking a solution. Here is the product page and the problem is on the checkout screen when you get to payment method. I’m not allowed to post a link to my website, so let me know if any other information is needed. Thanks for even taking the time to read it guys.

The error you have mentioned simply states that the variable named does not exist and you are attempting to use it on the lines mentioned.

Sponsor our Newsletter | Privacy Policy | Terms of Service