Jump to content

Modify order form


Guest

Recommended Posts

Can I jump in on the back of this as I have a related question?

When a customer goes into the checkout cart.php?act=step2 lists shipping as n/a. Clicking Continue gives essentially the same page with the shipping address and shipping rate dropdown available (I have Estelles big shipping mod but I dont think that makes a difference).

I feel the first page is a little confusing to include a blank shipping rate listing although I understand why it cant be propogated with info there.

I would like to edit steps 2 and 4 with perhaps removing the shipping in step 2 and a link out to a shipping rates help document in step 4.

Looking through cart.tpl I see a section for step 3 and for step 4 but crucially the area dealing with the shipping rates is after the step 4 section and as such is universal.

Is there a way of adding some sort of conditional to display shipping rates if the page is on step 4?

Link to comment
Share on other sites

Not sure about that, but I added an * next to n/a with a note at the bottom of the page of "*shipping costs will be calculated once you confirm the delivery address" as an easy solution.

Link to comment
Share on other sites

I have found the solution (to my question, not the OPs. Apols for what has turned into a threadjack). I shall add it here should anyone (Mysty?) need it.

Files to change:

cart.inc.php

cart.tpl

In cart.inc.php find the following (line 640ish)

if($shippingModules == TRUE){



$shippingPrice = "<select name='shipping' onchange=\"submitDoc('cart');\">";




Under $shippingPrice var add a new one. Call it what you like, in this instance we will call it $shippingHelp

Define it with your text for when the address is verified and the dropdowns for the shipping rates is visible, add any styling if required (it will be permanent styling. I have one fixed theme so I have not bothered with adapting it for multiple themes):


$shippingHelp = "

<div style=\"width: 100%;padding:5px 0; border: 1px solid #95c8f6; background: #daecfc; margin-top: 10px;\">

<p style=\"margin:0 5px; text-align:center;\">

Click <a href=\"#\" target=\"_blank\">here</a> for shipping rate help and  information.

</p>

</div>";


Dont forget to slash any quotes in the text/styling. My link in the text points at a document with shipping rates and other stuff. You can point it where you like or even nowhere.



Now we need to add the text for when the shipping shows n/a.

Still in cart.inc.php scroll down to line 700ish and find


} else {

	

$shippingPrice = $lang['front']['cart']['na'];


and add the same variable name as above and define it as the text you want for when the shipping rates dropdown is not yet available:


$shippingHelp = "

<div style=\"width: 100%;padding:5px 0; border: 1px solid #95c8f6; background: #daecfc; margin-top: 10px;\">

<p style=\"margin:0 5px; text-align:center;\">

Shipping costs are calculated once the invoice address has been verified.<br /> Click <a href=\"#\" target=\"_blank\">here</a> for shipping rates and further information.

</p>

</div>";
 



Now we have the variable defined we need to add it to the main $view_cart array so we can use it in our template.

Luckily we only need to scroll down a couple of lines to:


}

	

$view_cart->assign("LANG_SHIPPING",$lang['front']['cart']['shipping']);

	

$view_cart->assign("VAL_SHIPPING",$shippingPrice);



...




Add


	

$view_cart->assign("INFO_SHIPPING",$shippingHelp);


somewhere amongst this lot.



Save and close cart.inc.php





Now we need to add it to the template.

In cart.tpl add 
{INFO_SHIPPING}

wherever you want it.

Save, close and upload both files.

The only snag is the text will be in the same place whether or not the shipping rates are available or not so plan your text and layout accordingly.

You could double the varibles in cart.inc so you had one for rates available and another for when they are not and add both to the main view_cart array which would allow for two different locations. You might get empty var errors - I don't know. Try it and see.

Let me know if this helped anyone.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...