close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Hiding 1 Shipping Rule from Cart Display?

Thread began 9/08/2009 3:43 am by Nathon Jones Web Design | Last modified 10/05/2009 3:13 pm by Jason Byrnes | 2658 views | 6 replies |

Nathon Jones Web Design

Hiding 1 Shipping Rule from Cart Display?

I want to apply a shipping rule, basically if particular items are in the cart a flat rate surcharge is added to the shipping charge.

I've added this as a new rule, and it displays just fine on the checkout page, however my client just wants the surcharge to be added directly to the regular shipping charge.

Is this possible? I've got the two shipping rules listed in my cart properties window, but am a little unclear on how to hide one of them.

Would appreciate any advice, thanks.

Regards
Nathon

PS. 3/4 posts down, it would appear that this forum has been compromised (link to "sexy woman").

Sign in to reply to this post

Jason ByrnesWebAssist

On yur cart page, the code to display the shipping will look like:

php:
<?php
if (!$eCart1->Rules_EOF("Shipping")) {
    while (!
$eCart1->Rules_EOF("Shipping")) {
        if (
$eCart1->RuleLooperValue("Shipping") > 0) {
?>
           <tr>
              <td class="eC_IndividualCharge"><?php echo $eCart1->RuleLooperName("Shipping"); ?></td>
              <td><?php echo WA_eCart_DisplayMoney($eCart1$eCart1->RuleLooperValue("Shipping")); ?></td>
            </tr>
            <?php
        
}
        
$eCart1->Rules_MoveNext("Shipping");
}
    
$eCart1->Rules_MoveFirst("Shipping");
}
?>





You can add an if statement to this :
<?php if($eCart1->RuleLooperName("Shipping") != "RuleName") {; ?>

so the charge will only display if the name does not equal a certain value:

php:
<?php
if (!$eCart1->Rules_EOF("Shipping")) {
    while (!
$eCart1->Rules_EOF("Shipping")) {
        if (
$eCart1->RuleLooperValue("Shipping") > 0) {
?>
           <?php if($eCart1->RuleLooperName("Shipping") != "RuleName") {; ?><tr>
              <td class="eC_IndividualCharge"><?php echo $eCart1->RuleLooperName("Shipping"); ?></td>
              <td><?php echo WA_eCart_DisplayMoney($eCart1$eCart1->RuleLooperValue("Shipping")); ?></td>
            </tr><?php ?>
            <?php
        
}
        
$eCart1->Rules_MoveNext("Shipping");
}
    
$eCart1->Rules_MoveFirst("Shipping");
}
?>








We do get some spam in the forums from time to time, we remove it as soon as possible.

Sign in to reply to this post

Nathon Jones Web Design

Hi Jason,

I'm using ASP though. Does that mean I have no means of support now from WebAssist?
I did purchase the product at a time when you supported ASP so I'm hoping that I won't be left stranded. Thanks.

Here's the ASP code I have at the shipping section:

<%
if (NOT WA_eCart_Rules_EOF(BABYFISHCART, "Shipping")) then
while (NOT WA_eCart_Rules_EOF(BABYFISHCART, "Shipping"))
if (WA_eCart_RuleLooperValue(BABYFISHCART, "Shipping") > 0) then
%>
<tr>
<td class="eC_IndividualCharge">&nbsp;<%=WA_eCart_RuleLooperName(BABYFISHCART, "Shipping")%> (<%=(rsDelCountry.Fields.Item("countryname").Value)%>)</td>
<td>+ <%=WA_eCart_DisplayMoney(BABYFISHCART, WA_eCart_RuleLooperValue(BABYFISHCART, "Shipping"))%></td>
</tr>
<%
end if
set BABYFISHCART = WA_eCart_Rules_MoveNext(BABYFISHCART, "Shipping")
wend
set BABYFISHCART = WA_eCart_Rules_MoveFirst(BABYFISHCART, "Shipping")
end if
%>

Hope you can help, thanks.
Nathon.

Sign in to reply to this post

Jason ByrnesWebAssist

OK, for ASP, the code would be:

<%
if (NOT WA_eCart_Rules_EOF(BABYFISHCART, "Shipping")) then
while (NOT WA_eCart_Rules_EOF(BABYFISHCART, "Shipping"))
if (WA_eCart_RuleLooperValue(BABYFISHCART, "Shipping") > 0) then
%><% If WA_eCart_Rule LooperName(BABYFISHCART, "Shipping") <> "RuleName" Then %>
<tr>
<td class="eC_IndividualCharge">&nbsp;<%=WA_eCart_Rule LooperName(BABYFISHCART, "Shipping")%> (<%=(rsDelCountry.Fields.Item("countryname").Value )%>)</td>
<td>+ <%=WA_eCart_DisplayMoney(BABYFISHCART, WA_eCart_RuleLooperValue(BABYFISHCART, "Shipping"))%></td>
</tr><% End If %>
<%
end if
set BABYFISHCART = WA_eCart_Rules_MoveNext(BABYFISHCART, "Shipping")
wend
set BABYFISHCART = WA_eCart_Rules_MoveFirst(BABYFISHCART, "Shipping")
end if
%>
Sign in to reply to this post

Nathon Jones Web Design

Will I have to hide this shipping charge, in the settings, prior to adding this code to prevent it from displaying twice?

Sign in to reply to this post

Nathon Jones Web Design

Error

Hi. The code you've supplied is producing the following error:

Microsoft VBScript compilation error '800a03f9'
Expected 'Then'
/baby-gifts-checkout.asp, line 466

If WA_eCart_Rule LooperName(BABYFISHCART, "Shipping") <> "RuleName" Then
-----------------^

Any idea's what's causing this error?

Hope you can help. Thanks.
Nathon

Sign in to reply to this post

Jason ByrnesWebAssist

A space was added where it should not be:
If WA_eCart_Rule LooperName(BABYFISHCART, "Shipping") <> "RuleName" Then


should be:
If WA_eCart_RuleLooperName(BABYFISHCART, "Shipping") <> "RuleName" Then

here is the full code again. I am putting it in a code block so it will not be changed:

<%
if (NOT WA_eCart_Rules_EOF(BABYFISHCART, "Shipping")) then
while (NOT WA_eCart_Rules_EOF(BABYFISHCART, "Shipping"))
if (WA_eCart_RuleLooperValue(BABYFISHCART, "Shipping") > 0) then
%>
<tr>
<td class="eC_IndividualCharge">&nbsp;<%=WA_eCart_RuleLooperName(BABYFISHCART, "Shipping")%> (<%=(rsDelCountry.Fields.Item("countryname").Value)%>)</td>
<td>+ <%=WA_eCart_DisplayMoney(BABYFISHCART, WA_eCart_RuleLooperValue(BABYFISHCART, "Shipping"))%></td>
</tr>
<%
end if
set BABYFISHCART = WA_eCart_Rules_MoveNext(BABYFISHCART, "Shipping")
wend
set BABYFISHCART = WA_eCart_Rules_MoveFirst(BABYFISHCART, "Shipping")
end if
%>
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...