Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Show Change Billing And Shipping Address Tab When User Checkout Rate Topic   - - - - -

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 30 August 2017 - 04:09 PM #1

When user is registered and adds product to cart and when presses Buy Now Button he is taken to the Shipping Options Tab even if the user has not added the address after registration which causes an order creation issue, order gets created without address.

 

How can we take him to the address page if the data is missing ?


Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19063 posts

Posted 31 August 2017 - 06:11 AM #2

When user is registered and adds product to cart and when presses Buy Now Button he is taken to the Shipping Options Tab even if the user has not added the address after registration which causes an order creation issue, order gets created without address.

 

How can we take him to the address page if the data is missing ?

 

You can make some profile fields required for checkout page. In this case 3rd step should not be displayed


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • technoob
  • Senior Member
  • Trial users
  • Join Date: 08-Jun 15
  • 309 posts

Posted 31 August 2017 - 09:49 AM #3

You can make some profile fields required for checkout page. In this case 3rd step should not be displayed

 

Where to do this ?

do u mean by coding or is this some setting ?

 

If coding please guide which file/function it will be and will have a look



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19063 posts

Posted 31 August 2017 - 01:06 PM #4

Where to do this ?
do u mean by coding or is this some setting ?
 
If coding please guide which file/function it will be and will have a look


Check the Administration -> Profile fields page

http://prntscr.com/gfdte2


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 31 August 2017 - 01:59 PM #5

Yes its already marked Required http://prntscr.com/gfelhgbut it seems it doesnt honor it when the checkout is done.


Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19063 posts

Posted 01 September 2017 - 06:19 AM #6

Yes its already marked Required http://prntscr.com/gfelhgbut it seems it doesnt honor it when the checkout is done.

 

Hm. If I remember correctly, there was a condition in the code to show 3rd step only if all required fields are filled up


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 01 September 2017 - 07:19 AM #7

can u tell me where this condition is and i can test the code for validation of the condition ?


Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19063 posts

Posted 01 September 2017 - 01:34 PM #8

can u tell me where this condition is and i can test the code for validation of the condition ?

 

If I remember correctly, check the app/controllers/frontend/checkout.php

$billing_population = fn_check_profile_fields_population($cart['user_data'], 'B', $profile_fields);
$shipping_population = fn_check_profile_fields_population($cart['user_data'], 'S', $profile_fields);

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • technoob
  • Senior Member
  • Trial users
  • Join Date: 08-Jun 15
  • 309 posts

Posted 01 September 2017 - 11:44 PM #9

Had to add this section in step 3 validation to make it work

    if ($edit_step == 'step_three') {
    	$billing_population = fn_check_profile_fields_population($cart['user_data'], 'B', $profile_fields);
		$shipping_population = fn_check_profile_fields_population($cart['user_data'], 'S', $profile_fields);
		if  ($billing_population != true || $shipping_population != true   ){
		 $completed_steps['step_two'] = false;
        }
    }


 
  • technoob
  • Senior Member
  • Trial users
  • Join Date: 08-Jun 15
  • 309 posts

Posted 01 September 2017 - 11:46 PM #10

Also i found one strange piece of code where its checking if the profile fields are empty , shouldnt it check if its not empty rather than empty 

      if ($billing_population == true || empty($profile_fields['B'])) {
            // All mandatory Shipping address data exist.
            $shipping_population = fn_check_profile_fields_population($cart['user_data'], 'S', $profile_fields);
            Registry::get('view')->assign('shipping_population', $shipping_population);

            if ($shipping_population == true || empty($profile_fields['S'])) {
                $completed_steps['step_two'] = true;
            }
        }


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19063 posts

Posted 04 September 2017 - 06:45 AM #11

 

Also i found one strange piece of code where its checking if the profile fields are empty , shouldnt it check if its not empty rather than empty 

      if ($billing_population == true || empty($profile_fields['B'])) {
            // All mandatory Shipping address data exist.
            $shipping_population = fn_check_profile_fields_population($cart['user_data'], 'S', $profile_fields);
            Registry::get('view')->assign('shipping_population', $shipping_population);

            if ($shipping_population == true || empty($profile_fields['S'])) {
                $completed_steps['step_two'] = true;
            }
        }

 

You are right, strange code. Try to comment out the following line

$completed_steps['step_two'] = true;

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • technoob
  • Senior Member
  • Trial users
  • Join Date: 08-Jun 15
  • 309 posts

Posted 04 September 2017 - 10:11 AM #12

 

You are right, strange code. Try to comment out the following line

$completed_steps['step_two'] = true;

I think this should do fine instead of commenting ( made it non empty in condition )

      if ($billing_population == true || !empty($profile_fields['B'])) {
            // All mandatory Shipping address data exist.
            $shipping_population = fn_check_profile_fields_population($cart['user_data'], 'S', $profile_fields);
            Registry::get('view')->assign('shipping_population', $shipping_population);

            if ($shipping_population == true || !empty($profile_fields['S'])) {
                $completed_steps['step_two'] = true;
            }
        }


 
  • Zanin86
  • Newbie
  • Trial users
  • Join Date: 16-Dec 15
  • 11 posts

Posted 31 October 2017 - 08:47 AM #13

I've lost a lot of sales due to this problem and many customers have complained about not being able to register properly.
This is an unforgivable and incomprehensible bug.
I reported this error more than a year ago, without ever having responded.
And for this and other problems I am experiencing, I am moving to another cms.
 
In the moment I solved the problem by modifying this code:
$billing_population = fn_check_profile_fields_population($cart['user_data'], 'B', $profile_fields);
        Tygh::$app['view']->assign('billing_population', $billing_population);
       
        if ($billing_population == true || empty($profile_fields['B'])) {
            // All mandatory Shipping address data exist.
            $shipping_population = fn_check_profile_fields_population($cart['user_data'], 'S', $profile_fields);
            Tygh::$app['view']->assign('shipping_population', $shipping_population);

            if ($shipping_population == true || empty($profile_fields['S'])) {
                $completed_steps['step_two'] = true;
            }
        }

in this

$shipping_population = fn_check_profile_fields_population($cart['user_data'], 'S', $profile_fields);
            Tygh::$app['view']->assign('shipping_population', $shipping_population);

            if ($shipping_population == 1) {
                $completed_steps['step_two'] = false;
            }else{
                $completed_steps['step_two'] = true;
            }

and in Administration -> Profile fields page I set e-mails do not show under cechout