close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Writing php script properly to show new description

Thread began 1/27/2016 3:25 pm by mrobben375515 | Last modified 1/28/2016 11:00 pm by Ray Borduin | 179 views | 3 replies |

mrobben375515

Writing php script properly to show new description

I did a pro-service to help me create a shipping dropdown. It works great for US shipments. I need to edit the dropdown for International shipping.

This is the code for creating the dropdown to show for shipping options and value:
<td class="eC_SummaryLabel">Shipping</td>
<td id="eCart1_JSON_Display_Shipping"><select name="shipSelected">
<?php
foreach ($ShippingOptions AS $key=>$val) {

?>
<option value="<?php echo($key); ?>" <?php echo($key == $_SESSION['shipChoice']?"selected":""); ?>><?php echo($val[0]); ?>: $<?php echo(number_format($val[1]+3,2)); ?></option>
<?php

}
?>
</select></td>
</tr>

How can I edit this so as to ship "Shipping $9.00" if there is no value because it was a domestic shipment? I have the cart adding $9.00 to the total, but I need to show the description of where the $9.00 came from in the shipping dropdown. I am attaching the cart.php and web credentials so you can see the site live if it helps.

Sign in to reply to this post

Ray BorduinWebAssist

On line 378 you could add:

if (sizeof($ShippingOptions)==0) {
$ShippingOptions["04"] = array("International","9.00");
$_SESSION['shipChoice'] = "04";
} else if ($_SESSION['shipChoice'] == "04") {
$_SESSION['shipChoice'] = "03";
}

Then add code to the confirm_cart.php so that it doesn't bother to try to recalculate shipping for international (line 54).

I've gone ahead and made those updates.

Sign in to reply to this post

mrobben375515

Thank you so much for helping me with this. It is working fine now. I did notice that new users who are in the US are being registers their country as "United States" versus "US" the shipping is treating this as international shipping. I am going to fix the existing contacts who have their country as "US" to be "United States". I need to find the trigger that is associating "US" as the trigger for US shipping. When I search the cart.php code for "US", I only see it associated with the shipping parameters that are being sent to UPS's API. Is that the trigger? If I change the to read "United States", will that be accepted by the UPS API?

Sign in to reply to this post

Ray BorduinWebAssist

No, the UPS API requires the country code. It will only work with "US". The registration page must be storing the wrong value. Check the select list on that page.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...