Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

Here is the order page

 

$this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,

'currency' => $currency,

'currency_value' => $currencies->currencies[$currency]['value'],

'payment_method' => $payment,

'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),

'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),

'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),

'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),

'shipping_method' => $shipping['title'],

'shipping_cost' => $shipping['cost'],

'subtotal' => 0,

'tax' => 0,

'tax_groups' => array(),

//kgt - discount coupons

'coupon' => (isset($GLOBALS['coupon']) = $GLOBALS['coupon'] : ''), 'applied_discount' => array(),

//end kgt - discount coupons

'comments' => (isset($GLOBALS['comments']) ? $GLOBALS['comments'] : ''));

if (isset($GLOBALS[$payment]) && is_object($GLOBALS[$payment])) {

$this->info['payment_method'] = $GLOBALS[$payment]->title;

if ( isset($GLOBALS[$payment]->order_status) && is_numeric($GLOBALS[$payment]->order_status) && ($GLOBALS[$payment]->order_status > 0) ) {

$this->info['order_status'] = $GLOBALS[$payment]->order_status;

}

}

 

$this->customer = array('firstname' => $customer_address['customers_firstname'],

'lastname' => $customer_address['customers_lastname'],

'company' => $customer_address['entry_company'],

'street_address' => $customer_address['entry_street_address'],

'suburb' => $customer_address['entry_suburb'],

'city' => $customer_address['entry_city'],

'postcode' => $customer_address['entry_postcode'],

'state' => ((tep_not_null($customer_address['entry_state'])) ? $customer_address['entry_state'] : $customer_address['zone_name']),

'zone_id' => $customer_address['entry_zone_id'],

'country' => array('id' => $customer_address['countries_id'], 'title' => $customer_address['countries_name'], 'iso_code_2' => $customer_address['countries_iso_code_2'], 'iso_code_3' => $customer_address['countries_iso_code_3']),

'format_id' => $customer_address['address_format_id'],

'telephone' => $customer_address['customers_telephone'],

'email_address' => $customer_address['customers_email_address']);

 

$this->delivery = array('firstname' => $shipping_address['entry_firstname'],

'lastname' => $shipping_address['entry_lastname'],

'company' => $shipping_address['entry_company'],

'street_address' => $shipping_address['entry_street_address'],

'suburb' => $shipping_address['entry_suburb'],

'city' => $shipping_address['entry_city'],

'postcode' => $shipping_address['entry_postcode'],

'state' => ((tep_not_null($shipping_address['entry_state'])) ? $shipping_address['entry_state'] : $shipping_address['zone_name']),

'zone_id' => $shipping_address['entry_zone_id'],

'country' => array('id' => $shipping_address['countries_id'], 'title' => $shipping_address['countries_name'], 'iso_code_2' => $shipping_address['countries_iso_code_2'], 'iso_code_3' => $shipping_address['countries_iso_code_3']),

'country_id' => $shipping_address['entry_country_id'],

'format_id' => $shipping_address['address_format_id']);

 

$this->billing = array('firstname' => $billing_address['entry_firstname'],

'lastname' => $billing_address['entry_lastname'],

'company' => $billing_address['entry_company'],

'street_address' => $billing_address['entry_street_address'],

'suburb' => $billing_address['entry_suburb'],

'city' => $billing_address['entry_city'],

'postcode' => $billing_address['entry_postcode'],

'state' => ((tep_not_null($billing_address['entry_state'])) ? $billing_address['entry_state'] : $billing_address['zone_name']),

'zone_id' => $billing_address['entry_zone_id'],

'country' => array('id' => $billing_address['countries_id'], 'title' => $billing_address['countries_name'], 'iso_code_2' => $billing_address['countries_iso_code_2'], 'iso_code_3' => $billing_address['countries_iso_code_3']),

'country_id' => $billing_address['entry_country_id'],

'format_id' => $billing_address['address_format_id']);

 

$index = 0;

$products = $cart->get_products();

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

$this->products[$index] = array('qty' => $products[$i]['quantity'],

'name' => $products[$i]['name'],

'model' => $products[$i]['model'],

'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),

'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),

'price' => $products[$i]['price'],

'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),

'weight' => $products[$i]['weight'],

'id' => $products[$i]['id']);

 

if ($products[$i]['attributes']) {

$subindex = 0;

reset($products[$i]['attributes']);

while (list($option, $value) = each($products[$i]['attributes'])) {

$attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");

$attributes = tep_db_fetch_array($attributes_query);

 

$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],

'value' => $attributes['products_options_values_name'],

'option_id' => $option,

'value_id' => $value,

'prefix' => $attributes['price_prefix'],

'price' => $attributes['options_values_price']);

 

$subindex++;

}

}

 

//kgt - discount coupon

if( !empty( $this->info['coupon'] ) ) {

if( !isset( $this_coupon ) ) {

require_once( DIR_WS_CLASSES . 'discount_coupon.php' );

$this_coupon = new discount_coupon( $this->info['coupon'] );

}

$applied_discount = $this_coupon->calculate_discount( $this->products[$index], $n );

if( isset( $this->info['applied_discount'][$this->products[$index]['tax_description']] ) ) {

$this->info['applied_discount'][$this->products[$index]['tax_description']] += $applied_discount;

} else {

$this->info['applied_discount'][$this->products[$index]['tax_description']] = $applied_discount;

}

$this_actual_shown_price = null;

if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL == 'false' ) {

//we don't want to display the subtotal with the discount applied, so apply the discount then set the applied_discount variable to zero so that it's not added into the order subtotal, but is still used to correctly calculate tax

$this_actual_shown_price = ( tep_add_tax( $this->products[$index]['final_price'], $this->products[$index]['tax'] ) * $this->products[$index]['qty'] ) - $applied_discount;

$applied_discount = 0;

}

}

$shown_price = ( tep_add_tax( $this->products[$index]['final_price'], $this->products[$index]['tax'] ) * $this->products[$index]['qty'] ) - $applied_discount;

$this->info['subtotal'] += $shown_price;

//if we need to display the subtotal without the discount applied, then add the shown price to the subtotal, then change shown price to the price with the applied discount in order to properly calculate taxes

if( isset( $this_actual_shown_price ) ) $shown_price = $this_actual_shown_price;

//end kgt - discount coupon

 

$products_tax = $this->products[$index]['tax'];

$products_tax_description = $this->products[$index]['tax_description'];

if (DISPLAY_PRICE_WITH_TAX == 'true') {

$this->info['tax'] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

if (isset($this->info['tax_groups']["$products_tax_description"])) {

$this->info['tax_groups']["$products_tax_description"] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

} else {

$this->info['tax_groups']["$products_tax_description"] = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

}

} else {

$this->info['tax'] += ($products_tax / 100) * $shown_price;

if (isset($this->info['tax_groups']["$products_tax_description"])) {

$this->info['tax_groups']["$products_tax_description"] += ($products_tax / 100) * $shown_price;

} else {

$this->info['tax_groups']["$products_tax_description"] = ($products_tax / 100) * $shown_price;

}

}

 

$index++;

}

 

if (DISPLAY_PRICE_WITH_TAX == 'true') {

$this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];

} else {

$this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];

}

//kgt - discount coupon

if( !empty( $this->info['coupon'] ) && MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL == 'false' ) {

foreach( $this->info['applied_discount'] as $discount ){

$this->info['total'] -= $discount;

}

}

//end kgt - discount coupon

}

}

?>

Link to comment
Share on other sites

Here is the order page

 

$this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,

'currency' => $currency,

'currency_value' => $currencies->currencies[$currency]['value'],

'payment_method' => $payment,

 

SNIP

 

 

I have no way of knowing what line the error is happening on because you neither marked it, nor gave me the whole file. So I'd have to look through every line of what you posted and make a guess. Please either mark the line on which the error is occurring or send the whole thing.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Sorry about that I marked it in red its Line 167 where the if statement is thanks for the help.

error message: Parse error: parse error, unexpected T_IF, expecting ')' in /home/blingtee/public_html/store/catalog/includes/classes/order.php on line 167

 

$this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,

'currency' => $currency,

'currency_value' => $currencies->currencies[$currency]['value'],

'payment_method' => $payment,

'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),

'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),

'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),

'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),

'shipping_method' => $shipping['title'],

'shipping_cost' => $shipping['cost'],

'subtotal' => 0,

'tax' => 0,

'tax_groups' => array(),

//kgt - discount coupons

'coupon' => (isset($GLOBALS['coupon']) = $GLOBALS['coupon'] : ''), 'applied_discount' => array(),

//end kgt - discount coupons

'comments' => (isset($GLOBALS['comments']) ? $GLOBALS['comments'] : ''));

if (isset($GLOBALS[$payment]) && is_object($GLOBALS[$payment])) {$this->info['payment_method'] = $GLOBALS[$payment]->title;

if ( isset($GLOBALS[$payment]->order_status) && is_numeric($GLOBALS[$payment]->order_status) && ($GLOBALS[$payment]->order_status > 0) ) {

$this->info['order_status'] = $GLOBALS[$payment]->order_status;

}

}

 

$this->customer = array('firstname' => $customer_address['customers_firstname'],

'lastname' => $customer_address['customers_lastname'],

'company' => $customer_address['entry_company'],

'street_address' => $customer_address['entry_street_address'],

'suburb' => $customer_address['entry_suburb'],

'city' => $customer_address['entry_city'],

'postcode' => $customer_address['entry_postcode'],

'state' => ((tep_not_null($customer_address['entry_state'])) ? $customer_address['entry_state'] : $customer_address['zone_name']),

'zone_id' => $customer_address['entry_zone_id'],

'country' => array('id' => $customer_address['countries_id'], 'title' => $customer_address['countries_name'], 'iso_code_2' => $customer_address['countries_iso_code_2'], 'iso_code_3' => $customer_address['countries_iso_code_3']),

'format_id' => $customer_address['address_format_id'],

'telephone' => $customer_address['customers_telephone'],

'email_address' => $customer_address['customers_email_address']);

 

$this->delivery = array('firstname' => $shipping_address['entry_firstname'],

'lastname' => $shipping_address['entry_lastname'],

'company' => $shipping_address['entry_company'],

'street_address' => $shipping_address['entry_street_address'],

'suburb' => $shipping_address['entry_suburb'],

'city' => $shipping_address['entry_city'],

'postcode' => $shipping_address['entry_postcode'],

'state' => ((tep_not_null($shipping_address['entry_state'])) ? $shipping_address['entry_state'] : $shipping_address['zone_name']),

'zone_id' => $shipping_address['entry_zone_id'],

'country' => array('id' => $shipping_address['countries_id'], 'title' => $shipping_address['countries_name'], 'iso_code_2' => $shipping_address['countries_iso_code_2'], 'iso_code_3' => $shipping_address['countries_iso_code_3']),

'country_id' => $shipping_address['entry_country_id'],

'format_id' => $shipping_address['address_format_id']);

 

$this->billing = array('firstname' => $billing_address['entry_firstname'],

'lastname' => $billing_address['entry_lastname'],

'company' => $billing_address['entry_company'],

'street_address' => $billing_address['entry_street_address'],

'suburb' => $billing_address['entry_suburb'],

'city' => $billing_address['entry_city'],

'postcode' => $billing_address['entry_postcode'],

'state' => ((tep_not_null($billing_address['entry_state'])) ? $billing_address['entry_state'] : $billing_address['zone_name']),

'zone_id' => $billing_address['entry_zone_id'],

'country' => array('id' => $billing_address['countries_id'], 'title' => $billing_address['countries_name'], 'iso_code_2' => $billing_address['countries_iso_code_2'], 'iso_code_3' => $billing_address['countries_iso_code_3']),

'country_id' => $billing_address['entry_country_id'],

'format_id' => $billing_address['address_format_id']);

 

$index = 0;

$products = $cart->get_products();

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

$this->products[$index] = array('qty' => $products[$i]['quantity'],

'name' => $products[$i]['name'],

'model' => $products[$i]['model'],

'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),

'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),

'price' => $products[$i]['price'],

'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),

'weight' => $products[$i]['weight'],

'id' => $products[$i]['id']);

 

if ($products[$i]['attributes']) {

$subindex = 0;

reset($products[$i]['attributes']);

while (list($option, $value) = each($products[$i]['attributes'])) {

$attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");

$attributes = tep_db_fetch_array($attributes_query);

 

$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],

'value' => $attributes['products_options_values_name'],

'option_id' => $option,

'value_id' => $value,

'prefix' => $attributes['price_prefix'],

'price' => $attributes['options_values_price']);

 

$subindex++;

}

}

 

//kgt - discount coupon

if( !empty( $this->info['coupon'] ) ) {

if( !isset( $this_coupon ) ) {

require_once( DIR_WS_CLASSES . 'discount_coupon.php' );

$this_coupon = new discount_coupon( $this->info['coupon'] );

}

$applied_discount = $this_coupon->calculate_discount( $this->products[$index], $n );

if( isset( $this->info['applied_discount'][$this->products[$index]['tax_description']] ) ) {

$this->info['applied_discount'][$this->products[$index]['tax_description']] += $applied_discount;

} else {

$this->info['applied_discount'][$this->products[$index]['tax_description']] = $applied_discount;

}

$this_actual_shown_price = null;

if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL == 'false' ) {

//we don't want to display the subtotal with the discount applied, so apply the discount then set the applied_discount variable to zero so that it's not added into the order subtotal, but is still used to correctly calculate tax

$this_actual_shown_price = ( tep_add_tax( $this->products[$index]['final_price'], $this->products[$index]['tax'] ) * $this->products[$index]['qty'] ) - $applied_discount;

$applied_discount = 0;

}

}

$shown_price = ( tep_add_tax( $this->products[$index]['final_price'], $this->products[$index]['tax'] ) * $this->products[$index]['qty'] ) - $applied_discount;

$this->info['subtotal'] += $shown_price;

//if we need to display the subtotal without the discount applied, then add the shown price to the subtotal, then change shown price to the price with the applied discount in order to properly calculate taxes

if( isset( $this_actual_shown_price ) ) $shown_price = $this_actual_shown_price;

//end kgt - discount coupon

 

$products_tax = $this->products[$index]['tax'];

$products_tax_description = $this->products[$index]['tax_description'];

if (DISPLAY_PRICE_WITH_TAX == 'true') {

$this->info['tax'] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

if (isset($this->info['tax_groups']["$products_tax_description"])) {

$this->info['tax_groups']["$products_tax_description"] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

} else {

$this->info['tax_groups']["$products_tax_description"] = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

}

} else {

$this->info['tax'] += ($products_tax / 100) * $shown_price;

if (isset($this->info['tax_groups']["$products_tax_description"])) {

$this->info['tax_groups']["$products_tax_description"] += ($products_tax / 100) * $shown_price;

} else {

$this->info['tax_groups']["$products_tax_description"] = ($products_tax / 100) * $shown_price;

}

}

 

$index++;

}

 

if (DISPLAY_PRICE_WITH_TAX == 'true') {

$this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];

} else {

$this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];

}

//kgt - discount coupon

if( !empty( $this->info['coupon'] ) && MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL == 'false' ) {

foreach( $this->info['applied_discount'] as $discount ){

$this->info['total'] -= $discount;

}

}

//end kgt - discount coupon

}

}

?>

Edited by ramel_l2
Link to comment
Share on other sites

Sorry about that I marked it in red its Line 167 where the if statement is thanks for the help.

error message: Parse error: parse error, unexpected T_IF, expecting ')' in /home/blingtee/public_html/store/catalog/includes/classes/order.php on line 167

 

$this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,

'currency' => $currency,

'currency_value' => $currencies->currencies[$currency]['value'],

'payment_method' => $payment,

'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),

'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),

'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),

'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),

'shipping_method' => $shipping['title'],

'shipping_cost' => $shipping['cost'],

'subtotal' => 0,

'tax' => 0,

'tax_groups' => array(),

//kgt - discount coupons

'coupon' => (isset($GLOBALS['coupon']) = $GLOBALS['coupon'] : ''), 'applied_discount' => array(),

 

 

This last line is the problem. You must have edited it at some point, since I double-checked the install instructions and they look correct. The line should be:

 

'coupon' => (isset($GLOBALS['coupon']) ? $GLOBALS['coupon'] : ''), 'applied_discount' => array(),

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Posted by: kgt Jun 14 2006, 12:00 AM

 

Since you're using the itemized function, you're allowing Paypal to recalculate the shopping cart total. Not only will the subtotal be wrong, but so will tax.

 

In order for this to work, you either need to use the Aggregate cart for Paypal, or change the code for your Paypal payment module to send the discounted products prices. This would mean that the confirmation page on your site would look like this:

 

1 x Item 1 $9.99

-------------------

Discount: -$1.00

Subtotal: $8.99

Tax (assume 5%): $0.45

S&H: $5.00

Total: $14.44

 

And this is how it would look in Paypal:

 

1 x Item 1 $8.99

-------------------

Tax: $0.45

S&H: $5.00

Total: $14.44

 

So Paypal would display a different product price in order to trick it into calculating the correct total.

 

I want to use itemised function passing to paypal.

I am using oscommerce paypal_IPN contribution.

Any one has the code for this paypal module?

Link to comment
Share on other sites

I want to use itemised function passing to paypal.

I am using oscommerce paypal_IPN contribution.

Any one has the code for this paypal module?

 

 

I doubt it. I don't get the impression that anyone tried to get discounts working with itemized paypal carts. It's a problem for all discount contributions, since paypal doesn't have a way to specify a discount.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

You've probably uploaded something wrong. I'm not sure. Class ot_discount_coupon is not defined in includes/classes/discount_coupon.php.

 

Hi Kristen,

 

This is pretty baffling to me, too. I get a similar error, except it specifies line 0 in includes/classes/discount_coupon.php. I've read through the common_problems.txt file, and this entire support thread, and I've commented out the "require_once" lines but to no avail. I've even gone so far as to search the entire catalog installation for instances of ot_discount_coupon and only found it in catalog/includes/modules/order_total/ and in catalog/includes/modules/order_total.

 

The weirdest thing is that if I completely delete both instances of the file, the error no longer appears and i can see the module in the control panel. I know I don't have one of these files anywhere else...

 

-- Arden

Link to comment
Share on other sites

Hi Kristen,

 

This is pretty baffling to me, too. I get a similar error, except it specifies line 0 in includes/classes/discount_coupon.php. I've read through the common_problems.txt file, and this entire support thread, and I've commented out the "require_once" lines but to no avail. I've even gone so far as to search the entire catalog installation for instances of ot_discount_coupon and only found it in catalog/includes/modules/order_total/ and in catalog/includes/modules/order_total.

 

What is the exact error you get? Does includes/classes/discount_coupon.php have any code referring to ot_discount_coupon?

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

What is the exact error you get? Does includes/classes/discount_coupon.php have any code referring to ot_discount_coupon?

 

I think I found my error. I must have copied a single ot_discount_coupon.php to both places, instead of one of each unique-but-identically-named file to its respective location. Now that I reloaded the files to the correct locations everything seems to be working. Sorry for the false alarm, and thank you for putting the effort into not only developing this add-on, but for the obvious effort you're putting into supporting it. -- Arden

Link to comment
Share on other sites

I have added this contribution and when I try to add a coupon I get this message:

 

1054 - Unknown column 'coupons_max_order' in 'field list'

 

insert into discount_coupons ( coupons_id, coupons_description, coupons_discount_percent, coupons_date_start, coupons_date_end, coupons_max_use, coupons_min_order, coupons_max_order, coupons_number_available) values ('james', 'james', '1', "2006-07-20", "2007-07-20", 1, 5, 5, 0)

 

Does anyone have any ideas? I could really use your help.

Link to comment
Share on other sites

I have added this contribution and when I try to add a coupon I get this message:

 

1054 - Unknown column 'coupons_max_order' in 'field list'

 

insert into discount_coupons ( coupons_id, coupons_description, coupons_discount_percent, coupons_date_start, coupons_date_end, coupons_max_use, coupons_min_order, coupons_max_order, coupons_number_available) values ('james', 'james', '1', "2006-07-20", "2007-07-20", 1, 5, 5, 0)

 

Does anyone have any ideas? I could really use your help.

 

To add to my last post:

 

I also get this message when I run the query in MyPHPadmin -

 

SQL query:

 

ALTER TABLE discount_coupons CHANGE date_start coupons_date_start DATETIME DEFAULT NULL ;

 

 

 

MySQL said:

 

#1054 - Unknown column 'date_start' in 'discount_coupons'

 

And every query thereafter except for the final query asked to run in the 2.0 update.

 

Thanks for your help in fixing this issue.

 

James

Link to comment
Share on other sites

Ok, this is kind of an old thread but I just installed this contribution, and now when I go into customers and click edit, there is no info displayed for the customer, and at the top of the page it says this:

 

 

Warning: reset(): Passed variable is not an array or object in /shop/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /shop/admin/includes/classes/object_info.php on line 18

 

 

What is this?

Link to comment
Share on other sites

Thank you for those who have developed this great contribution!

 

I have just installed it, and I wonder is there possibility to give some specific discount, example 20 euros?

 

This is covered in the manual. You should be able to find it as a link from the coupons admin page in the upper right corner.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Lo all,

Has anyone used this with Individual Shipping Options Contrib??

Im having problems as the Shipping Costs arent being included in the discount...

 

 

This could probably be made to work without too much effort. It would require you to edit includes/classes/discount_coupon.php. You would need to just add the shipping cost to the 'final_price' in the calculate_discount() function.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Ok, this is kind of an old thread but I just installed this contribution, and now when I go into customers and click edit, there is no info displayed for the customer, and at the top of the page it says this:

Warning: reset(): Passed variable is not an array or object in /shop/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /shop/admin/includes/classes/object_info.php on line 18

What is this?

 

 

Since you're looking under customers, I'd be surprised if this was the cause of the error. This contribution doesn't change either the customers section or the object_info.php file.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

To add to my last post:

 

I also get this message when I run the query in MyPHPadmin -

 

SQL query:

 

ALTER TABLE discount_coupons CHANGE date_start coupons_date_start DATETIME DEFAULT NULL ;

MySQL said:

 

#1054 - Unknown column 'date_start' in 'discount_coupons'

 

And every query thereafter except for the final query asked to run in the 2.0 update.

 

Thanks for your help in fixing this issue.

 

James

 

 

You've probably already made the changes. If you have successfully changed the column date_start to coupons_date_start and you try to run those statements, you would get exactly that error.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

This looks like a great contribution..I was just wondering, what does the "Number Available" field refer to? I guess it doesnt mean the number of times it can be used? because that is probably Max used? Or does Max used mean maximum use per customer?

 

Any clarification would really help.

 

Ash

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...