1

I have a facility in admin, where admin can change the product visibility for the particular user group now.

Update the 'Edit User Group' page to enable the administrator to determine which parts of the checkout process apply to the selected user group. Add the section called 'Checkout Options' as circled in red in Figure 1 below. The user can select the ;'Checkout Process' they desire for the user group they are editing. There are two options that should appear in the drop down menu;

  1. Default
  2. Custom

Figure 1 enter image description here If the user selects 'Custom', then 'Checkout Configuration' check-boxes should appear as circled in red, in Figure 2 below. The checkboxes represent the 5 step checkout process. All check-boxes should be 'checked' by default. Figure 2 enter image description here

LOGIC

If administrator un-check any checkbox, then particuler step remove from the checkout process on front end for that customer group.

For example, if

  • Billing Information

  • Shipping Information

    are unticked, the the checkout process because a 3 step process as follows;

  • Shipping Method

  • Payment Information

  • Order Review

I stuck in the logic and don't know how to do it

1 Answer 1

0

Hide checkout steps based on selection of checkbox This functionality can be added by using this magento extension named as Customize Checkout Steps But you have to change some logic as per in requirement in asked question is mentioned . The modification of extension's code will have to change the skipping logic by which the module is using to skip and the controller

The below code is for data.php file present in Helper folder

 public function skipShippingMethod()
    {
        $code               = $this->getShippingMethod();
        $current_group      = $this->getCurrentCustomersGroup();
        $checkout_steps     = Mage::getModel('expense/checkoutsteps')->load($current_group, 'group_id');
        $checkoutValue      = $checkout_steps['checkout_steps'];
        $customArray        = explode(',',$checkoutValue,-1);
        $checkoutValueArray = array_map('trim', $customArray);
        if($checkout_steps['checkout_process']=='default_checkout_process')
        {
            $return = false;
        }
        else
        {
            if(in_array('shipping_method', $checkoutValueArray))
            {
                $return = false;
            }
            else
            {
                $return = true;
            }
        }

        return $return;
    } 
     public function skipPaymentMethod()
    {
        $code               = $this->getPaymentMethod();
        $current_group      = $this->getCurrentCustomersGroup();
        $checkout_steps     = Mage::getModel('expense/checkoutsteps')->load($current_group, 'group_id');
        $checkoutValue      = $checkout_steps['checkout_steps'];
        $customArray        = explode(',',$checkoutValue,-1);
        $checkoutValueArray = array_map('trim', $customArray);

        if($checkout_steps['checkout_process']=='default_checkout_process')
        {
            $return = false;
        }

        else 
        {
            if(in_array('payment', $checkoutValueArray))
            {
                $return = false;
            }
            else
            {
                $return = true;
            }

        }

        return $return;
    } 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.