close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

PS2 Results and Shipping Options

Thread began 2/20/2010 2:45 pm by paul.urgero235355 | Last modified 5/20/2010 6:51 pm by Eric Mittman | 3022 views | 27 replies |

Paul

PS2 Results and Shipping Options

My client wants to give the person searching for items, the ability to select to view more than 5 results per page at a time. Is this possible?

Also, they are drop shipping the products from distributors. How can I set up the ability to give the customer the ability to select shipping methods (overnight, ground, 2-day, etc)?

Thanks,
Paul

PS...there is a typo in the admin\orders_results.php page. The heading says: View Oders, not View Orders. :)

Sign in to reply to this post

Eric Mittman

The number of products that you see per page on the results is controlled by this line of code near around line 147 on my Products_Results.php page:

php:
$maxRows_WADAProducts = 5;



To have users select how many to show you can add in links like this toward the top of the results page:

html:
Results per page: <a href="Products_Results.php?num_results=5">5</a>&nbsp;<a href="Products_Results.php?num_results=10">10</a>&nbsp;<a href="Products_Results.php?num_results=20">20</a>



Once you have added the links you then need to update the line of code that controls the results per page to look like this:

php:
$maxRows_WADAProducts = isset($_GET['num_results'])?$_GET['num_results']:5;



The page will still default to 5, then the user can click on a link to show the number of records they want. The updated code for the $maxRows will check to see if there is a number of results URL parameter and use that, if not it will default to 5.

Sign in to reply to this post

Paul

Eric,
That worked flawlessly. Thanks.

Can you point me to the instructions about setting up shipping options? I don't see any instructions in the PDF's I've downloaded.

Thanks

Sign in to reply to this post

Eric Mittman

I have asked around and it seems that this info is not available in any guides. I can give you some pointers though.

The idea is that the user will select the service type for the provider you are using by making their selection from a list on the checkout page. This posted value from this list should be saved in a session variable. You will then reference that session variable in the shipping quote server behavior.

How you would start this is by opening up your checkout page and adding in the service select list. The code for the select list can be found in the snippets tab of the file panel. In here select WA eCart then select shipping, from this list choose the service types for you shipping provider. This is the code for the select list, you can just copy and paste it into your checkout form.

Next, on the confirm page you will add a set session value server behavior. Set the trigger to the posted service select list, then for the value select the service select list.

The final part is to edit the shipping quote server behavior and use the lightning bolt icon to select the session variable you just created for the service selection.

This should allow you to make use of the service selection that the user made in your shipping server behavior.

Sign in to reply to this post

Paul

Eric,

Thanks for going above and beyond. Now if I can take you a little bit further, I am almost there.

I added the select list to the checkout page. I created the server behavior on the confirm page, but I'm getting this error:

PHP Notice: Undefined variable: WA_Store_Cart in C:\Inetpub\wwwroot\hcprivate\AcalaMed\acalamedical.com\www\confirm.php on line 14 PHP Fatal error: Call to a member function GetRuleValueByName() on a non-object in C:\Inetpub\wwwroot\hcprivate\AcalaMed\acalamedical.com\www\confirm.php on line 14

I'm not sure how to set the last variable you mentioned. Here is code surrounding line 14:

<?php
if (!session_id()) session_start();
if(($WA_Store_Cart->GetRuleValueByName("Shipping", urldecode("UPS Shipping")) != "")) {
$_SESSION["Shipping"] = "".$WA_Store_Cart->GetRuleValueByName("Shipping", urldecode("UPS Shipping")) ."";
}
?>

Thanks

Sign in to reply to this post

Eric Mittman

Firstly you will want to make sure that any code that references an eCart method occurs after the include of the eCart file.

That would clear up the error you are getting I think but it would not make it work. If you used the default service selection code from the snippets then the name of you shipping services select list should be UPS_Service.

So the set session value server behavior should look like this:

php:
<?php
if (!session_id()) session_start();
if(isset(
$_POST['UPS_Service']) && $_POST['UPS_Service'] != "") {
$_SESSION["Shipping"] = "".$_POST['UPS_Service'] ."";
}
?>



You should then be able to use this session variable as the value of the service type in the shipping server behavior.

Sign in to reply to this post

Paul

Hi Eric,

Ok, I moved the code after the ecart include at line 14.

I pasted your code:
UPS_Service
<?php
if (!session_id()) session_start();
if(isset($_POST['UPS_Service'] && $_POST['UPS_Service'] != "") { $_SESSION["Shipping"] = "".$_POST['UPS_Service'] .""; }
?>

after:

<?php
require_once("WA_eCart/PP_ECO_Scripts/PP_ECO_PHP.php");
?>

Changed the server behavior name to UPS_Service, uploaded the file, and now I get this error:

PHP Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in C:\Inetpub\wwwroot\hcprivate\AcalaMed\acalamedical.com\www\confirm.php on line 34

Line 34 is from your code, that starts with: if(isset

any thoughts?

Thanks again!

Sign in to reply to this post

Eric Mittman

Sorry about that, it looks like you got the original code from my post, I had to edit that code because of the syntax error, the code in that post was updated but here it is again, you should use this for the set session value code:

php:
<?php

if (!session_id()) session_start();
if(isset(
$_POST['UPS_Service']) && $_POST['UPS_Service'] != "") {
$_SESSION["Shipping"] = "".$_POST['UPS_Service'] ."";
}
?>
Sign in to reply to this post

Paul

That worked, Eric...thanks!

But, (isn't there usually a but?)...on the confirm, checkout_success pages, and in the confirming email, it doesn't show what shipping method was selected.

What should I add?

Thanks.

Sign in to reply to this post

Eric Mittman

Just below the code to set the session variable add in this php code to set another session variable to the name of the service type:

php:
<?php 
$_SESSION
['UPS_ServiceName'] = ""
switch(
$_SESSION['Shipping']){ 
    case 
"01"
        
$_SESSION['UPS_ServiceName'] = "Next Day Air"
        break; 
    case 
"02"
        
$_SESSION['UPS_ServiceName'] = "2nd Day Air"
        break; 
    case 
"03"
        
$_SESSION['UPS_ServiceName'] = "Ground"
        break; 
    case 
"07"
        
$_SESSION['UPS_ServiceName'] = "Worldwide Express"
        break; 
    case 
"08"
        
$_SESSION['UPS_ServiceName'] = "Worldwide Expedited"
        break; 
    case 
"11"
        
$_SESSION['UPS_ServiceName'] = "Standard"
        break; 
    case 
"12"
        
$_SESSION['UPS_ServiceName'] = "3 Day Select"
        break; 
    case 
"13"
        
$_SESSION['UPS_ServiceName'] = "Next Day Air Saver"
        break; 
    case 
"14"
        
$_SESSION['UPS_ServiceName'] = "Next Day Air Early AM"
        break;     
    case 
"54"
        
$_SESSION['UPS_ServiceName'] = "Worldwide Express Plus"
        break; 
    case 
"59"
        
$_SESSION['UPS_ServiceName'] = "2nd Day Air AM"
        break; 
    case 
"65"
        
$_SESSION['UPS_ServiceName'] = "Express Saver"
        break; 
    default: 
        
$_SESSION['UPS_ServiceName'] = "NA"
        break; 

?>



You would then use the $_SESSION['UPS_ServiceName'] variable wherever you would like to see the service type used.

Sign in to reply to this post
loading

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