Page 1 of 1

Promotions module question - Calguy?

Posted: Sun May 15, 2011 5:36 am
by cdndesigns
I have set up and am using the Calguy ecommerce setup with Cart, Orders, FEU, Self-Registration, Paypal, and Promotions modules.

In the Order process, I have the FE user logged in, sees View Cart with the order, clicks Checkout, and goes to the Billing address screen, then the Confirm Order screen. At the bottom of that page where the order subtotal and details shows up, I inserted the {promotions} coupon code entry box.

However, entering a coupon code and submitting gives a new page which only has the coupon code entry box again and so the user is now stuck there instead of viewing the order with the discounted total and carrying on to payment - very NON user friendly. Everything is working and without using a coupon code is smooth - but using a coupon brings the user into a frustrating loop.

I need to solve this. Been through all the templates, code, settings etc and can't figure out how to make the template action

Code: Select all

<input type="submit" name="{$actionid}promo_submit" value="{$mod->Lang('submit')}"/>
just update and refresh the total on the Confirm Order page instead of go to a new page.

The page ID which has the promotions coupon code box is
"http://www.mysite.com/index.php?page=ch ... rder_id=12"

Upon entering the coupon code, I end up back on my Checkout page (which is blank and just has {Orders} on it)
"http://www.mysite.com/index.php?page=checkout" but now it just has the coupon code box and whether the coupon was valid or not - it is working fine as far as the coupons go - but now there is no option to view the order, see an updated total, proceed to payment etc. To get out of the dead end as the buyer you have to go up to the cart nav, click View Cart, and go back through the billing address and next to Confirm Order again, at which point you see that the discount is now being applied and can proceed to payment via Paypal.

So where in the module coding is the {$actionid}promo_submit defined as to what page you go to afterward.. or how can I get it to just update the existing order page with the correct new total and leave the proceed to payment at the bottom so customers can just pay after receiving their discounted total??

HELP!!???

My Confirm Orders template is here, just to show where Promotions was added:

Code: Select all

{* display the order notes *}
{if $order_obj->get_order_notes() != '' }
<br/>
<fieldset>
<legend><strong>{$Orders->Lang('order_notes')}:</strong> (<a href="{$edit_url}">Edit</a>):</legend>
{$order_obj->get_order_notes()}
</fieldset>
{/if}

{Promotions} 
<br/>
<fieldset>
<legend><strong>{$Orders->Lang('payment_options')}:</strong></legend>

  {* this is where the payment gateway plugin should be *}
  {if isset($payment_gateway_form)}{$payment_gateway_form}{/if}
</fieldset>

Re: Promotions module question - Calguy?

Posted: Mon May 16, 2011 9:07 pm
by cdndesigns
Anyone?? Still trying to solve this...

Also SOME of my Users are being randomly logged out when they return to View Cart - have been trying in different computers and browsers and have been able to duplicate it but random.. not tied to a particular browser, computer or ISP. Very frustrating.. it dumps the cart and then requires user to log in again to an empty cart.

Re: Promotions module question - Calguy?

Posted: Tue May 17, 2011 8:08 am
by M@rtijn
Please don't bump the topic within 24 hours of asking the original question (or having made the last post)

If somebody can help you, he/she will when he/she has time to do so.

Re: Promotions module question - Calguy?

Posted: Wed May 18, 2011 11:27 pm
by cdndesigns
M@rtijn - was actually about 30-36 hrs but sorry...

Well since no response received and site owner was freaking out as this was costing sales... have bypassed the system to go straight to Paypal cart for now and dropping Zencart in behind the CMSMS site for checkout/store/cart functions instead... this setup has not been workable unfortunately since it logged a whole bunch of potential sales out. Am quite upset as I was excited to use CMSMS modules for a shopping cart site for the first time... I'm a die-hard CMSMS user but alas I don't think it's totally ready for full ecommerce yet. :'(

If anyone can fix this bug I would be interested in trying again in the future, so I'll keep this thread alive for now in hopes someone is trying to figure it out!

:)

Re: Promotions module question - Calguy?

Posted: Wed Jun 01, 2011 5:43 am
by Lukevdp
I agree, I'm having the same issue. In most shopping cart software, coupons can be added to the cart, and the discount shows up at the cart.

In this case, the coupon is on the order process instead. It would be great for it to be Ajax so it doesn't add another page into the order process.

Re: Promotions module question - Calguy?

Posted: Sun Jun 05, 2011 10:49 pm
by maranc
Problem with Promotions is that tag {Promotions} is working always as noinline. you can set {Promotions inline='1'} or {Promotions inline='0'} - it has the same effect - after submit page with checkout constains only cuppon form template. Answer is very simple - because I cant provide solution [against forum rule] please look is source code in action.default.php in Promotions module

Marek A.

BTW - i agree that coupon code must be in cart (not in order processing). Whats more - most of newest cart shopping is using ajax....

Re: Promotions module question - Calguy?

Posted: Mon Jul 04, 2011 9:43 am
by airelibre
Hello,

I'm working with the Promotions module for an E-commerce website, and if I use :

Code: Select all

{Promotions inline=1}
The form is displayed inline..

I'm searching a solution in order to display the promotion in the cart - If I find something, I'll post here ;)

Re: Promotions module question - Calguy?

Posted: Mon Jul 04, 2011 11:20 am
by airelibre
Here's a simple user defined tag to display informations about coupons codes the user entered :

Code: Select all

foreach ($_SESSION['Promotions']['coupons'] as $val)
{
	// Search the promo id from the coupon code
	$promo = $val;

	$gCms = cmsms();
	$db = $gCms->GetDb();
	$res = $db->GetOne('SELECT promotion_id FROM ' . PROMOTIONS_COND_TABLE . ' WHERE `data`=?', array($promo));

	if ($res)
	{
		$promo = promo_ops::load_promo_by_id($res);
		echo 'Your coupon : ' . $promo->get_name();
		echo ' : - $' . $promo->get_offer_data();
	}
}
I just tested it in the Cart module template and it works - It might work in every page.

The version presented here suits for coupon codes - you can suit it to your needs with the public methods of the 'promotion' class (in modules/Promotions/lib/class.promotion.php)