[CubeCart] Speed Customers Mod

Magic SEO URLs for CubeCart.
AIPman1
Posts: 13
Joined: Wed Aug 05, 2009 8:35 am

[CubeCart] Speed Customers Mod

Postby AIPman1 » Thu Aug 06, 2009 4:43 am

The Speed Customers Through Checkout mod by Estelle adds this code to the step1.inc:

Code: Select all

httpredir("index.php?_g=co&_a=reg&co=1");


after this line:

Code: Select all

httpredir("index.php?_g=co&_a=step2");


So the original redir works, but estelle's addition doesn't. There would need to be additional handling of that redir in the htaccess, I assume...but I would be unable to write it, don't know enough to.

If anyone can provide something to get the Speed Customers mod to work in Magic SEO, that would be great.

Magic SEO is supposed to not break any mods - so if I can help find a fix for this, then it's claim will remain solid, and it'll help the community.

I am sure that this is the line that breaks the checkout, commenting it back out in the code makes the checkout work fine...just without the benefit of the removing the step the mod is designed for.

Hope I spoke clearly and this is useful information. I have also posted similar information in the support thread for the mod itself...

here is that post:

http://www.cubecartforums.org/index.php ... st&p=43150

I will report any finding from either side of this to the other so that people searching for info can find it faster.

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [CubeCart] Speed Customers Mod

Postby inveo » Thu Aug 06, 2009 5:07 am

Could you please post how your entire step1.inc.php file looks? It seems that the only problem is that you integrated this mod incorrectly.

AIPman1
Posts: 13
Joined: Wed Aug 05, 2009 8:35 am

Re: [CubeCart] Speed Customers Mod

Postby AIPman1 » Fri Aug 07, 2009 5:19 am

here it is, thanks for looking:

Code: Select all

<?php
/*
+--------------------------------------------------------------------------
|   CubeCart 4
|   ========================================
|   CubeCart is a registered trade mark of Devellion Limited
|   Copyright Devellion Limited 2006. All rights reserved.
|   Devellion Limited,
|   5 Bridge Street,
|   Bishops Stortford,
|   HERTFORDSHIRE.
|   CM23 2JU
|   UNITED KINGDOM
|   http://www.devellion.com
|   UK Private Limited Company No. 5323904
|   ========================================
|   Web: http://www.cubecart.com
|   Email: info (at) cubecart (dot) com
|   License Type: CubeCart is NOT Open Source Software and Limitations Apply
|   Licence Info: http://www.cubecart.com/v4-software-license
+--------------------------------------------------------------------------
|   step1.inc.php
|   ========================================
|   Step 1 Of the Checkout Pages (Login/Sign Up)   
+--------------------------------------------------------------------------
*/
if(!defined('CC_INI_SET')){ die("Access Denied"); }

// include lang file
$lang = getLang("includes".CC_DS."content".CC_DS."step1.inc.php");

$enableSSl = 1;
require_once("classes".CC_DS."cart".CC_DS."shoppingCart.php");
$cart = new cart();
$basket = $cart->cartContents($cc_session->ccUserData['basket']);

if($cc_session->ccUserData['customer_id']>0) {
   httpredir("index.php?_g=co&_a=step2");
}
/* start mod: Speed new customers through checkout - http://cubecart.expandingbrain.com */
else
{
   httpredir("index.php?_g=co&_a=reg&co=1");
}
/* end mod: Speed new customers through checkout - by Estelle */

$login_register = new XTemplate ("content".CC_DS."step1.tpl");

$login_register->assign("LANG_CART",$lang['step1']['cart']);
$login_register->assign("LANG_CHECKOUT",$lang['step1']['checkout']);
$login_register->assign("LANG_PAYMENT",$lang['step1']['payment']);
$login_register->assign("LANG_COMPLETE",$lang['step1']['complete']);

if($basket == false) {
   $login_register->assign("LANG_CART_EMPTY",$lang['step1']['lang_empty_cart']);
   $login_register->parse("session_page.cart_false");
   } else {
   $login_register->assign("LANG_LOGIN_TITLE",$lang['step1']['allready_customer']);
   $login_register->assign("LANG_LOGIN_BELOW",$lang['step1']['login_below']);
   $login_register->assign("VAL_SELF",urlencode( currentPage()) );
   $login_register->assign("LANG_USERNAME",$lang['step1']['username']);
   
   if(isset($_POST['username'])) {
      $login_register->assign("VAL_USERNAME",sanitizeVar($_POST['username']));
   }
   
   $login_register->assign("LANG_PASSWORD",$lang['step1']['password']);
   $login_register->assign("LANG_REMEMBER",$lang['step1']['remember_me']);
   $login_register->assign("TXT_LOGIN",$lang['step1']['login']);
   $login_register->assign("LANG_FORGOT_PASS",$lang['step1']['forgot_pass_q']);
   $login_register->assign("LANG_EXPRESS_REGISTER",$lang['step1']['need_register']);
   $login_register->assign("LANG_CONT_REGISTER",$lang['step1']['express_register']);
   $login_register->assign("LANG_REGISTER_BUTN",$lang['step1']['reg_and_cont']);
   $login_register->assign("LANG_CONT_SHOPPING",$lang['step1']['cont_shopping_q']);
   $login_register->assign("LANG_CONT_SHOPPING_BTN",$lang['step1']['cont_shopping']);
   $login_register->assign("LANG_CONT_SHOPPING_DESC",$lang['step1']['cont_browsing']);
   $login_register->parse("session_page.cart_true");

}

$login_register->parse("session_page");
$page_content = $login_register->text("session_page");
?>

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [CubeCart] Speed Customers Mod

Postby inveo » Thu Aug 13, 2009 2:44 pm

I just reproduced this problem in test environment. It does not work because CubeCart violates RFC for sending some HTTP headers.

You can workaround it by adding following code to the end of the .htaccess file:

For single language mode:

Code: Select all

#index.php - Fixing non-RFC redirection (Speed Customers Mod)
RewriteCond %{QUERY_STRING} ^_g=co&_a=reg&co=1
RewriteRule ^shopping-cart/index.php$ index.php [R=301,L,QSA]


For multi-language mode:

Code: Select all

#index.php - Fixing non-RFC redirection (Speed Customers Mod)
RewriteCond %{QUERY_STRING} ^_g=co&_a=reg&co=1
RewriteRule ^([a-z]{2})/shopping-cart/index.php$ index.php [R=301,L,QSA]

AIPman1
Posts: 13
Joined: Wed Aug 05, 2009 8:35 am

Re: [CubeCart] Speed Customers Mod

Postby AIPman1 » Thu Aug 20, 2009 4:41 am

I'll test that out and thank you!

AIPman1
Posts: 13
Joined: Wed Aug 05, 2009 8:35 am

Re: [CubeCart] Speed Customers Mod

Postby AIPman1 » Thu Aug 20, 2009 6:19 am

works fine, thanks again!

AIPman1
Posts: 13
Joined: Wed Aug 05, 2009 8:35 am

Re: [CubeCart] Speed Customers Mod

Postby AIPman1 » Thu Aug 20, 2009 6:50 am

Ok, one small related issue to this mod still....

this mod adds links on the register page of the checkout, so if you are not already logged in, in speeding through checkout, you see:

Already have an account? Please log in or use the forgot password feature if you cannot remember your password.

the login URL is: http://www.dimestoredistro.com/account/ ... co&_a=cart

which, after logging in, should bring you back to the cart, but instead, is ignoring the redir part, and going back to the homepage.

So perhaps to complete the full compatibility of this mod, we need further work-around in the httacces?

Thank you for your attention to this. The mod FUNCTIONS now, but the redirect to the homepage could annoy repeat customers...

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [CubeCart] Speed Customers Mod

Postby inveo » Thu Aug 20, 2009 6:04 pm

This is also caused by violating a RFC - CubeCart uses two exclamations marks in URL (just like this MOD) and this is not allowed.

The easisest way how to solve it is to replace added code in language/en/includes/content/reg.inc.php:

Code: Select all

/* start mod: Speed new customers through checkout - http://cubecart.expandingbrain.com */
'email_in_use' => "An account already exists with that email address. Please <a href='login.html?redir=index.php&amp;_g=co&amp;_a=cart'>log in</a> or use the <a href='index.php?_a=forgotPass'>forgot password</a> feature if you cannot remember your password.",
/* end mod: Speed new customers through checkout - by Estelle */

AIPman1
Posts: 13
Joined: Wed Aug 05, 2009 8:35 am

Re: [CubeCart] Speed Customers Mod

Postby AIPman1 » Fri Aug 21, 2009 3:39 am

I'll report that to the mod writer...but any suggestions on what to change it TO?

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [CubeCart] Speed Customers Mod

Postby inveo » Wed Aug 26, 2009 10:54 am

Please see my previous post...