News:

Support the VirtueMart project and become a member

Main Menu

Checkout by stages

Started by Clocked0ne, April 18, 2012, 14:06:44 PM

Previous topic - Next topic

turoco

Quote from: Maxim Pishnyak on September 14, 2013, 09:21:11 AM
1.
Quote from: turoco on September 14, 2013, 09:02:48 AM
Quote from: PRO on September 11, 2013, 01:31:07 AM
o , you are trying to "set payment"
these are not the codes for that. I saw something like that in the forums, but dont know where
No, i am not trying to set payment.
2.
Quote from: turoco on September 14, 2013, 09:04:55 AM
Quote from: Maxim Pishnyak on September 12, 2013, 10:35:24 AM
Quote from: PRO on September 11, 2013, 01:31:07 AM
o , you are trying to "set payment"
Turoco, did you try to search existing solution for this on forum?
...
So are you trying to set payment (2.) or are you not trying to do this (1.)?

I do not understand the definition of: "to set a payment". Im trying to get Pro's checkout working where the words: "payment method" will only be ticked off in green when a customer actually selects a payment.

BTW, is this checkout layout the same till 2.0.22? or has it changed in 2.0.22?

sfinx

#31
I ve been reading this (and similar) posts for 2 days now and I just cant get anything to work.
I also need 4 step checkout in my shop. I am using latest 2.0.22c version .

I created steps.php, but I dont get it.. If I put link to steps in my default.php it just shows me like "Attention Billing Address Completed", "Attention billing adress completes" msg on a place that I added code - everything else on page is the same as before . There is still one page checkout there with aeverything (billing, select shipping, payment, coupon, terms....) .  I am not a programer, but as far as I see default.php actualy has complete one page checkout inside. I dont even get why are there separate "select shipment.php", "shopper adress.php" etc.

Some help or even better - complete code (default.php and steps.php) that works would be really apriciated. Otherwise I am gonna loose at least 14 days with this and I guess for some of you this woult take hmm... a minute - so please :)

I just cant belive that VM doesnt have that 4 step option.

PRO

Quote from: PRO on September 09, 2013, 21:23:20 PM
you cannot test for empty with payment and shipping.

because the name is
No payment selected
No shipment selected



<?php if (empty($this->cart->shipmentName)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?view=cart&task=editshipment',$this->useXHTML,$this->useSSL) ?>">
      Enter your shipment
      </a><br/><?php }?>
<?php if (!empty($this->cart->shipmentName)){ ?><img alt="Attention" src="/images/green.png" /> shipment method completed<br/><?php }?>

<?php if (empty($this->cart->paymentName)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?view=cart&task=editpayment',$this->useXHTML,$this->useSSL) ?>">
      Enter your payment 2
      </a><br/><?php }?>
<?php if (!empty($this->cart->paymentName)){ ?><img alt="Attention" src="/images/green.png" /> payment method selected<br/><?php }?>


^^^^^^^^^^^^^^^^^^^^^    this will NEVER work    (!empty($this->cart->shipmentName

BECAUSE the shipment name is NEVER empty. It will always be true and show a green check.
When no shipment is selected, it is "no shipment selected"
When no payment is selected, it is "no payment selected"

SO: when you test for an empty shipment name, or payment name. it will never be empty.

This is my current steps.php

<div class="cream border width60 bblack left10"><h2>Checkout Steps</h2>
<div class="left10">
<?php if (empty($this->cart->BT)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT',$this->useXHTML,$this->useSSL) ?>">
      Please Fill Out Your Billing Address
      </a><br/><?php }?>
<?php if (!empty($this->cart->BT)){ ?><img alt="Attention" src="images/green.png" /> Billing Address Completed<br/><?php }?>

<?php if ($this->cart->cartData['paymentName'] == 'No payment selected') {?><span class="redtext bold left10">!</span> <?php $this->select_payment_text='Select Your Payment Method'; echo JHTML::_('link', JRoute::_('index.php?view=cart&task=editpayment',$this->useXHTML,$this->useSSL), $this->select_payment_text,'class="bold details font14 m4"'); ?>  <br/><?php }?>

<?php if ($this->cart->cartData['paymentName'] != 'No payment selected') {?><img alt="Attention" src="images/green.png" /> Payment Selected <br/><?php }?>
<?php if ((!empty($this->cart->BT)) && (empty($this->cart->ST))){ ?>
      <a class="details bold font14" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[]='.$this->cart->lists['current_id'],$this->useXHTML,$this->useSSL) ?>">
      Add a Different Shipping Address </a><?php } ?>

<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') )){
echo '<div class="bottom10 border bold center lightcream top10 left10 bblack" style="width:255px;font-size:25px;">';
         echo $this->checkout_link_html;
         $text = JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
         echo '</div>';

}?>
</div></div>





IF you are using a NON english language, you have to change these texts
No payment selected
No shipment selected

I do not use multiple shipment methods, so you will not see it in my code



sfinx

PRO you really are a pro :)
Would you be so nice, to help me define where exactly in my default.php should I put lik to steps.php. Like I said my logic is that I would have to delete everything in it and only add link to steps, but that doesnt work...

My original (without modifications) defaul.php looks like this:

<?php defined ('_JEXEC') or die('Restricted access');
/*------------------------------------------------------------------------------------------------------------
# VP SuperMart! Joomla 2.5 Template for VirtueMart 2.0
# ------------------------------------------------------------------------------------------------------------
# Copyright (C) 2012 VirtuePlanet Services LLP. All Rights Reserved.
# License - GNU General Public License version 2. http://www.gnu.org/licenses/gpl-2.0.html
# Author: VirtuePlanet Services LLP
# Email: info@virtueplanet.com
# Websites:  http://www.virtueplanet.com
------------------------------------------------------------------------------------------------------------*/
vmJsApi::jPrice();
JHtml::('behavior.formvalidation');
$document JFactory::getDocument ();
$cartProductCount count($this->cart->products);
?>


<div class="cart-view row-fluid">
<div class="span12">
<h1 class="cart-page-title"><?php echo JText::('COM_VIRTUEMART_CART_TITLE'); ?>&nbsp;<span class="septa">/</span>&nbsp;<span><?php echo JText::sprintf('COM_VIRTUEMART_CART_X_PRODUCTS'$cartProductCount); ?></span></h1>
<?php echo shopFunctionsF::getLoginForm ($this->cartFALSE); ?>
</div>
<?php if (VmConfig::get ('oncheckout_show_steps'1) && $this->checkout_task === 'confirm') {
vmdebug ('checkout_task'$this->checkout_task);
echo '<div class="checkoutStep" id="checkoutStep4">' JText::('COM_VIRTUEMART_USER_FORM_CART_STEP4') . '</div>';
?>
<?php include("steps.php"); ?>
<?php 
/* Cart Page Module - 'cart-promo' */
$attribs['style'] = 'container';
$db JFactory::getDBO();
$query "
SELECT *
FROM #__modules
WHERE published=1
AND position='cart-promo'
ORDER BY id
;"
;
$db->setQuery($query);
$modulesList $db->loadObjectList('id');
if(isset($modulesList)) {
echo '<div class="clear"></div>';
$cartModCount count($modulesList);
$N 1;
foreach($modulesList as $module) {
$module_title $module->title;
$module_name $module->module;
if (JModuleHelper::isEnabled($module_name)) {
  $mod JModuleHelper::getModule($module_name$module_title);
if($N==$cartModCount) {
$last ' last-mod';
} else {
$last '';
}
          echo 
'<div class="row-fluid"><div class="cart-promo-mod span12'.$last.'">'.JModuleHelper::renderModule($mod$attribs).'</div></div>';

$N++;

} ?>

<?php echo $this->loadTemplate ('pricelist');
if ($this->checkout_task) {
$taskRoute '&task=' $this->checkout_task;
}
else {
$taskRoute '';
?>

<form method="post" id="checkoutForm" name="checkoutForm" action="<?php echo JRoute::('index.php?option=com_virtuemart&view=cart' $taskRoute$this->useXHTML$this->useSSL); ?>">
<div id="checkout-advertise-box">
<?php if (!empty($this->checkoutAdvertise)) {
foreach ($this->checkoutAdvertise as $checkoutAdvertise) { ?>

<div class="checkout-advertise">
<?php echo $checkoutAdvertise?>
</div>
<?php }
}?>

</div>
<div class="customer-comment">
<span class="comment"><?php echo JText::('COM_VIRTUEMART_COMMENT_CART'); ?></span><br/>
<textarea class="customer-comment span12" name="customer_comment" cols="60" rows="3"><?php echo $this->cart->customer_comment?></textarea>
</div>
<div class="checkout-button-top">
<?php if (!class_exists ('VirtueMartModelUserfields')) {
require(JPATH_VM_ADMINISTRATOR DS 'models' DS 'userfields.php');
}
$userFieldsModel VmModel::getModel ('userfields');
if ($userFieldsModel->getIfRequired ('agreed')) { ?>

<label for="tosAccepted" class="checkbox">
<?php if (!class_exists ('VmHtml')) {
require(JPATH_VM_ADMINISTRATOR DS 'helpers' DS 'html.php');
}
echo VmHtml::checkbox ('tosAccepted'$this->cart->tosAccepted10'class="terms-of-service"');
if (VmConfig::get ('oncheckout_show_legal_info'1)) { ?>

<a href="#full-tos" class="terms-of-service" data-toggle="modal">
<?php echo JText::('COM_VIRTUEMART_CART_TOS_READ_AND_ACCEPTED'); ?>
</a>
<div class="boot-modal fade" id="full-tos" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel"><?php echo JText::('COM_VIRTUEMART_CART_TOS'); ?></h3>
</div>
<div class="modal-body">
<p><?php echo $this->cart->vendor->vendor_terms_of_service?></p>
</div>
</div>
<?php ?>
</label>
<?php ?>
<div class="row-fluid continue-checkout-box">
<div class="span6 continue-cont">
<?php if ($this->continue_link_html != '') {
echo $this->continue_link_html;
?>

</div>
<div class="span6 checkout-cont">
<?php echo $this->checkout_link_html?>
</div>
</div>
</div>
<input type='hidden' name='task' value='<?php echo $this->checkout_task?>'/>
<input type='hidden' name='option' value='com_virtuemart'/>
<input type='hidden' name='view' value='cart'/>
</form>
</div>

PRO

i would put it where you have it


sfinx

Ok, but if thats all that has to be done, why do I still have one page checkout? Do I need to delete some other files or something?

I attached print screen of my Cart page at the moment.

[attachment cleanup by admin]

PRO

that is because you have a template or plugin with 1 page checkout.

i dont know anything about it

sfinx

Is there any link where I can see you checkout page in action?

sfinx

#38
Ok one more question. I am trying to get here, by creating every stage by my self. I understand what code to copy in certain stages, but I dont know php, so I dont know how to create button to navigate between steps.
So basically I will put link to step1.php in my default.php and when step1 opens and users edits it I would like to have button on the bottom (like go to next step) that would open step2.php. In the final step I will include order confirmation button. Hopefully that would work.

Other solution I thought about is that I would have stages all in one page, but in tabs. But again... thats just too much for my knowledge...
I know that must be pretty simple stuff, but like I said php is a mistery to me  :-[

turoco

Quote from: PRO on September 17, 2013, 02:51:17 AM
Quote from: PRO on September 09, 2013, 21:23:20 PM
you cannot test for empty with payment and shipping.

because the name is
No payment selected
No shipment selected



<?php if (empty($this->cart->shipmentName)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?view=cart&task=editshipment',$this->useXHTML,$this->useSSL) ?>">
      Enter your shipment
      </a><br/><?php }?>
<?php if (!empty($this->cart->shipmentName)){ ?><img alt="Attention" src="/images/green.png" /> shipment method completed<br/><?php }?>

<?php if (empty($this->cart->paymentName)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?view=cart&task=editpayment',$this->useXHTML,$this->useSSL) ?>">
      Enter your payment 2
      </a><br/><?php }?>
<?php if (!empty($this->cart->paymentName)){ ?><img alt="Attention" src="/images/green.png" /> payment method selected<br/><?php }?>


^^^^^^^^^^^^^^^^^^^^^    this will NEVER work    (!empty($this->cart->shipmentName

BECAUSE the shipment name is NEVER empty. It will always be true and show a green check.
When no shipment is selected, it is "no shipment selected"
When no payment is selected, it is "no payment selected"

SO: when you test for an empty shipment name, or payment name. it will never be empty.

This is my current steps.php

<div class="cream border width60 bblack left10"><h2>Checkout Steps</h2>
<div class="left10">
<?php if (empty($this->cart->BT)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT',$this->useXHTML,$this->useSSL) ?>">
      Please Fill Out Your Billing Address
      </a><br/><?php }?>
<?php if (!empty($this->cart->BT)){ ?><img alt="Attention" src="images/green.png" /> Billing Address Completed<br/><?php }?>

<?php if ($this->cart->cartData['paymentName'] == 'No payment selected') {?><span class="redtext bold left10">!</span> <?php $this->select_payment_text='Select Your Payment Method'; echo JHTML::_('link', JRoute::_('index.php?view=cart&task=editpayment',$this->useXHTML,$this->useSSL), $this->select_payment_text,'class="bold details font14 m4"'); ?>  <br/><?php }?>

<?php if ($this->cart->cartData['paymentName'] != 'No payment selected') {?><img alt="Attention" src="images/green.png" /> Payment Selected <br/><?php }?>
<?php if ((!empty($this->cart->BT)) && (empty($this->cart->ST))){ ?>
      <a class="details bold font14" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[]='.$this->cart->lists['current_id'],$this->useXHTML,$this->useSSL) ?>">
      Add a Different Shipping Address </a><?php } ?>

<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') )){
echo '<div class="bottom10 border bold center lightcream top10 left10 bblack" style="width:255px;font-size:25px;">';
         echo $this->checkout_link_html;
         $text = JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
         echo '</div>';

}?>
</div></div>





IF you are using a NON english language, you have to change these texts
No payment selected
No shipment selected

I do not use multiple shipment methods, so you will not see it in my code




I copy this exact code in step.php but it still shows payment is selected with a green tick when I aint even filled in my billing address nor shipping address. Why is the code automatically ticking of the payment method? where do i have to look? HELP...im crying

PRO

Quote from: sfinx on September 19, 2013, 10:32:26 AM
Is there any link where I can see you checkout page in action?

it should not be that hard to find my site.

I do not link to my site from the forum.

Look in my signature

PRO

Quote from: turoco on September 20, 2013, 10:09:58 AM
Quote from: PRO on September 17, 2013, 02:51:17 AM
Quote from: PRO on September 09, 2013, 21:23:20 PM
you cannot test for empty with payment and shipping.

because the name is
No payment selected
No shipment selected



<?php if (empty($this->cart->shipmentName)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?view=cart&task=editshipment',$this->useXHTML,$this->useSSL) ?>">
      Enter your shipment
      </a><br/><?php }?>
<?php if (!empty($this->cart->shipmentName)){ ?><img alt="Attention" src="/images/green.png" /> shipment method completed<br/><?php }?>

<?php if (empty($this->cart->paymentName)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?view=cart&task=editpayment',$this->useXHTML,$this->useSSL) ?>">
      Enter your payment 2
      </a><br/><?php }?>
<?php if (!empty($this->cart->paymentName)){ ?><img alt="Attention" src="/images/green.png" /> payment method selected<br/><?php }?>


^^^^^^^^^^^^^^^^^^^^^    this will NEVER work    (!empty($this->cart->shipmentName

BECAUSE the shipment name is NEVER empty. It will always be true and show a green check.
When no shipment is selected, it is "no shipment selected"
When no payment is selected, it is "no payment selected"

SO: when you test for an empty shipment name, or payment name. it will never be empty.

This is my current steps.php

<div class="cream border width60 bblack left10"><h2>Checkout Steps</h2>
<div class="left10">
<?php if (empty($this->cart->BT)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT',$this->useXHTML,$this->useSSL) ?>">
      Please Fill Out Your Billing Address
      </a><br/><?php }?>
<?php if (!empty($this->cart->BT)){ ?><img alt="Attention" src="images/green.png" /> Billing Address Completed<br/><?php }?>

<?php if ($this->cart->cartData['paymentName'] == 'No payment selected') {?><span class="redtext bold left10">!</span> <?php $this->select_payment_text='Select Your Payment Method'; echo JHTML::_('link', JRoute::_('index.php?view=cart&task=editpayment',$this->useXHTML,$this->useSSL), $this->select_payment_text,'class="bold details font14 m4"'); ?>  <br/><?php }?>

<?php if ($this->cart->cartData['paymentName'] != 'No payment selected') {?><img alt="Attention" src="images/green.png" /> Payment Selected <br/><?php }?>
<?php if ((!empty($this->cart->BT)) && (empty($this->cart->ST))){ ?>
      <a class="details bold font14" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[]='.$this->cart->lists['current_id'],$this->useXHTML,$this->useSSL) ?>">
      Add a Different Shipping Address </a><?php } ?>

<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') )){
echo '<div class="bottom10 border bold center lightcream top10 left10 bblack" style="width:255px;font-size:25px;">';
         echo $this->checkout_link_html;
         $text = JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
         echo '</div>';

}?>
</div></div>





IF you are using a NON english language, you have to change these texts
No payment selected
No shipment selected

I do not use multiple shipment methods, so you will not see it in my code




I copy this exact code in step.php but it still shows payment is selected with a green tick when I aint even filled in my billing address nor shipping address. Why is the code automatically ticking of the payment method? where do i have to look? HELP...im crying

post your url

a you using english as a language?

PRO

change this

<?php if ($this->cart->cartData['paymentName'] == 'No payment selected') {?><span class="redtext bold left10">!</span> <?php $this->select_payment_text='Select Your Payment Method'; echo JHTML::_('link', JRoute::_('index.php?view=cart&task=editpayment',$this->useXHTML,$this->useSSL), $this->select_payment_text,'class="bold details font14 m4"'); ?>  <br/><?php }?>

to this


<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] == 'No payment selected') )){ ?><span class="redtext bold left10">!</span> <?php $this->select_payment_text='Select Your Payment Method'; echo JHTML::_('link', JRoute::_('index.php?view=cart&task=editpayment',$this->useXHTML,$this->useSSL), $this->select_payment_text,'class="bold details font14 m4"'); ?>  <br/><?php }?>


turoco

fck, i wanna break my nuts now..still no change. The latest code looks like:
<div class="cream border width60 bblack left10"><h2>Checkout Steps</h2>
<div class="left10">
<?php if (empty($this->cart->BT)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT',$this->useXHTML,$this->useSSL?>">
      Please Fill Out Your Billing Address
      </a><br/><?php }?>
<?php if (!empty($this->cart->BT)){ ?><img alt="Attention" src="images/green.png" /> Billing Address Completed<br/><?php }?>

<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] == 'No payment selected') )){ ?><span class="redtext bold left10">!</span> <?php $this->select_payment_text='Select Your Payment Method'; echo JHTML::_('link'JRoute::_('index.php?view=cart&task=editpayment',$this->useXHTML,$this->useSSL), $this->select_payment_text,'class="bold details font14 m4"'); ?>  <br/><?php }?>

<?php if ($this->cart->cartData['paymentName'] != 'No payment selected') {?><img alt="Attention" src="images/green.png" /> Payment Selected <br/><?php }?>
<?php if ((!empty($this->cart->BT)) && (empty($this->cart->ST))){ ?>
      <a class="details bold font14" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[]='.$this->cart->lists['current_id'],$this->useXHTML,$this->useSSL?>">
      Add a Different Shipping Address </a><?php ?>

<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') )){
 echo 
'<div class="bottom10 border bold center lightcream top10 left10 bblack" style="width:255px;font-size:25px;">';
         echo 
$this->checkout_link_html;
         
$text JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
         echo 
'</div>';

}
?>

</div></div>



And already another member has made the VM2 checkout into a VM1 checkout but aint telling us the code: http://forum.virtuemart.net/index.php?topic=106459.msg393264#msg393264

PRO



change this


<?php if ($this->cart->cartData['paymentName'] != 'No payment selected') {?><img alt="Attention" src="images/green.png" /> Payment Selected <br/><?php }?>

to this

<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') )){ ?><img alt="Attention" src="images/green.png" /> Payment Selected <br/><?php }?>


i think the problem comes from no payment methods will show at all, unless they are assigned to something.