close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Upload and Store Shipping Method in Database

Thread began 6/20/2013 9:10 am by joerg431091 | Last modified 6/20/2013 11:54 am by joerg431091 | 608 views | 4 replies |

joerg431091

Upload and Store Shipping Method in Database

Hi all,

I hope someone can give me an ideas for the following problem:

We have 2 shipping methods in e-Cart (FedEx and USPS) that are chosen automatically depending on the total order amount. (Orders up to $50.00 ship USPS and orders exceeding $50.00 ship FedEx).

We needed to have the chosen shipping method included into the Database so we can download the correct shipping method from the DB into our Bookkeeping system.

So I created a new field in the DB (OrderShipMethod) and linked this in the "Store Cart Summary in Database" server behavior as follows: We applied the Session Value in the eCart [Present Shipping Title] which is <?php echo $eCart1->RuleLooperName("Shipping"); ?> to the new DB column [OrderShipMethod].

The problem is that always the first shipping method in eCart is uploaded to the database regardless of the order value in the cart.

Any help would be appreciated.

Thanks a lot.

AJ

Sign in to reply to this post

Jason ByrnesWebAssist

you need to loop through the shipping rules to find the one that has a value greater than 0 and use that to set the session:

for example:

php:
<?php

$_SESSION
['shipName'] = "";
if (!
$eCart1->Rules_EOF("Shipping")) {
    while (!
$eCart1->Rules_EOF("Shipping")) {
        if (
$eCart1->RuleLooperValue("Shipping") > 0) {
            
$_SESSION['shipName'] .= " ".$eCart1->RuleLooperName("Shipping")." ";
        }
        
$eCart1->Rules_MoveNext("Shipping");
}
    
$eCart1->Rules_MoveFirst("Shipping");
}
?>




make sure that code comes before the store order summary code, go to the bindings panel, click the plus button and select Session variable, name the session binding shipName

in the store order summary behavior, use the shipName binding to store the shipping method.

Sign in to reply to this post

joerg431091

Hi Jason,

Thanks so much for your answer. It seem to work now.

CORRECTION: I must have included it incorrectly since I just noticed that it did still pull the first shipping method in the cart.

I now just receive the following error in the confirm.php page during checkout:

Warning: Cannot modify header information - headers already sent by (output started at /home/anderjoe/public_html/confirm.php:370) in /home/anderjoe/public_html/confirm.php on line 684

The order goes through and ship method seems to be inserted correctly but the confirm.php page does not change to the checkout_success.php page. I did put the code you provided directly above the "WA eCart Store Cart Summary in DB" code.

CORRECTION: The order does go through but the shipping method is still incorrect.

Where should I place the code so the order confirmation comes through?

Thanks again,

Joerg

Sign in to reply to this post

Jason ByrnesWebAssist

when you added the code you must have left a bklank line between php tags, or a blank space after a closing php tag to cause that error.

look for blank lines between php tags at line 370

Sign in to reply to this post

joerg431091

AWESOME!!!!!!!!!!!!!!!!!!

Works absolutely PERFECT now.

Man you are the BEST!

Thanks a lot and have a great day.

AJ

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...