|
|
Shopping Software
Training - Advanced Script Changes |
 |
| |
|
How can you get the mini cart display to show prices as per
my requirements? For example, it shows the inclusive price even
if you choose to show tax exclusive prices on the store pages.
Edit ActinicOrder.pm
(Open with notepad)
Search for 'sub GenerateCartCookie'
Scroll down untill you see...
my $nTotal = $Response[6];
$Response is an array which contains the following values...
2 - sub total
3 - shipping
4 - tax 1
5 - tax 2
6 - total
7 - tax 1 on shipping (fraction of 4 that is due to shipping)
8 - tax 2 on shipping (fraction of 5 that is due to shipping)
9 - handling
10 - tax 1 on handling (fraction of 4 that is due to handling)
11 - tax 2 on handling (fraction of 5 that is due to handling)
Normal reported value is total(6).
For total excluding tax but including shipping and handling
change the above to...
my $nTotal = $Response[2] + $Response[3];
For total excluding tax, shipping and handling change the above
to...
my $nTotal = $Response[2];
To exclude shipping and handling may not be enough, it may also
be
necessary to exclude the tax on shipping and handling in which
case...
$Response[2] + $Response[4] + $Response[5] - $Response[7] -
$Response[8] - $Response[10] - $Response[11]
This should be the cart sub total plus tax on the cart sub total.
Save and Exit. Update the site.
Actinic is not able to provide any detailed support for script
changes made. If you find that there is a problem, an original
copy of the script can be found within the 'Original' folder
in your installation. Copy this into your site folder, replace
the script you have changed and upload to you site. If you have
a test facility, we strongly recommend that you test any changes
before you upload them to your live site.
|
|
How can I hide the component quantities in the Cart Table?
This can be done by
editing the Perl script ActinicOrder.pm.
- Locate the file ActinicOrder.pm in the site folder.
- Edit the file using a text editor such as Notepad.
- Search for
$pComponent->{'QUANTITY'},
There are two occurrences, only change the first. The second
is used to display the component quantity when the Component
is set to appear as a separate product.
- replace the line with...
$pComponent->{' '},
- Save and exit.
- Update the site (Web | Update Website).
Actinic is not able to provide any detailed support for script
changes made. If you find that there is a problem, an original
copy of the script can be found within the 'Original' folder
in your installation. Copy this into your site folder.
|
|
How do I change the URL to which a customer is bounced once
they 'Add to Cart'?
This requires a change to ShoppingCart.pl
Edit ShoppingCart.pl in the site folder using Notepad.
- Search for 'sub BounceAfterAddToCart'.
- Then search for 'ReturnToLastPage'.
You should see the following 2 lines...
@Response = ReturnToLastPage($nBounceDelay, ACTINIC::GetPhrase(-1,
1962) . $sCartHTML . ACTINIC::GetPhrase(-1, 1970) . ACTINIC::GetPhrase(-1,
2051),
$sPageTitle);
Comment out the 2 lines by inserting a '#' at the start of each
line and add a call to BounceToPageEnhanced so it now reads...
#@Response = ReturnToLastPage($nBounceDelay, ACTINIC::GetPhrase(-1,
1962) . $sCartHTML . ACTINIC::GetPhrase(-1, 1970) . ACTINIC::GetPhrase(-1,
2051),
#$sPageTitle);
my $sDestinationUrl = "http://yourserver/path/page.html" ;
@Response = ACTINIC::BounceToPageEnhanced($nBounceDelay, ACTINIC::GetPhrase(-1,
1962) . $sCartHTML . ACTINIC::GetPhrase(-1, 1970)
. ACTINIC::GetPhrase(-1, 2051), $sPageTitle, $::g_sWebSiteUrl,
$::g_sContentUrl, $::g_pSetupBlob, $sDestinationUrl, \%::g_InputHash);
Replace "http://yourserver/path/page.html" in the above code
with the desired URL.
There is a refinement required to make this work in B2B.
Instead of using a fixed URL we need to use the search script
to load the required section, the search script will take care
of the B2B processing.
Instead of using...
my $sDestinationUrl = "http://yourserver/path/page.html" ;
use...
my $sDestinationUrl = "http://yourserver/cgi-bin/ss000001.pl?SECTIONID=page.html&NOLOGIN=1"
;
If you are using scriptID 1 then ss000001 is Ok, else it needs
to be changed to match the scriptID in 'Web | Network Setup'.
Save and exit. Update the site.
Actinic is not able to provide any detailed support for script
changes made. If you find that there is a problem, an original
copy of the script can be found within the 'Original' folder
in your installation. Copy this into your site folder, replace
the script you have changed and upload to you site. If you have
a test facility, we strongly recommend that you test any changes
before you upload them to your live site. |
|
Is
it possible to prevent specific products from appearing in the
search results?
This is a change to the SearchScript.pl Perl script which will
mean that any products that end in 'x' will not be shown in
the search results. Note that the search results sequence numbers
will show a missing result.
Open SearchScript.pl within a text editor such as Notepad and
locate the following line:
for ($nCount = $nMin; $nCount < $nMax; $nCount++) # process
the range of product references in the results set
Immediately after this line add the 2 lines:
{ # patch
if ( $$rarrResults[$nCount] !~ /x$/ ) # hide products that have
reference ending in x
Then a little way below this, look for the pair of lines
$sHTML .= ACTINIC::ParseXML($sResultMarkup); # parse the XML
}
Immediately after this pair of lines add the single line
} # patch
Then save the file and upload to test it. Actinic is not able
to provide any detailed support for script changes made. If
you find that there is a problem, an original copy of the script
can be found within the 'Original' folder in your installation.
Copy this into your site folder.
With grateful thanks to Norman Rouxel for this solution.
|
|
Can
I use images for my Back, Next and Cancel Buttons in the Checkout?
You can
use images for the 'Next', 'Back' and 'Cancel' buttons in the
checkout. This requires a little Perl customisation, so please
carry out the steps in this exercise with care.
Click on the 'Design' tab and in the 'Select Page Type' box,
choose 'Checkout page 1'. In the preview pane, click on the
'Back' button to display the code for this button. You should
see:
<input type="submit" name="ACTION" value="<actinic:variable
encoding="html" name="BackButton" />" />
Change this to read:
<!--<input type="submit" name="ACTION" value="<actinic:variable
encoding="html" name="BackButton" />" /> -->
<input type=IMAGE name=ACTION_BACK src="back.gif">
Then click on the 'Cancel' button in the preview pane and change
the code to:
<!--<input type="submit" name="ACTION" value="<actinic:variable
encoding="html" name="CancelButton" />" /> -->
<input type="image" name="ACTION_CANCEL" src="cancel.gif"
/>
Finally, click on the 'Next' button in the preview pane and
change the code to:
<!--<input type="submit" name="ACTION" value="<actinic:variable
encoding="html" name="NextButton" />" /> -->
<input type="image" name="ACTION_NEXT" src="next.gif" />
The above assumes that 'back.gif' is the image you want to use
for the back button, 'cancel.gif' is the image you want to use
for the cancel button and 'next.gif' is the image you want to
use for the next button. These images need to already be in
your 'Site1' (or equivalent) folder.)
Next, locate 'OrderScript.pl' within your 'Site1' (or equivalent)
folder with Notepad and find the following code:
@Response = ReadAndParseBlobs(); # read the catalog blobs
($Status, $Message) = @Response; # parse the response
if ($Status != $::SUCCESS)
{
ACTINIC::ReportError($Message, ACTINIC::GetPath());
}
Underneath it, copy and paste the following code:
if(!defined $::g_InputHash{"ACTION"})
{
if(defined $::g_InputHash{"ACTION_BACK.x"})
{
$::g_InputHash{"ACTION"} = ACTINIC::GetPhrase(-1, 503);
}
elsif(defined $::g_InputHash{"ACTION_CANCEL.x"})
{
$::g_InputHash{"ACTION"} = ACTINIC::GetPhrase(-1, 505);
}
elsif(defined $::g_InputHash{"ACTION_NEXT.x"})
{
$::g_InputHash{"ACTION"} = ACTINIC::GetPhrase(-1, 502);
}
}
Save and close the template and upload to see your new button
images.
Actinic is not able to provide any detailed support for script
changes made. If you find that there is a problem, an original
copy of the script can be found within the 'Original' folder
in your installation. Copy this into your site folder.
|
|
I
am showing prices in two currencies, but I only want the prices
in the shopping cart (and checkout) to show one currency.
Probably the path from
the CGI Bin to the acatalog directory in Web | Network Setup
is incorrect.
If it is currently set to ./acatalog then try ../acatalog and
refresh the site (Web | Refresh Website). Once the problem is
resolved you should remove the acatalog folder from the cgi-bi
|
|
Is
there any way of capturing the customer's IP address with the
order?
Yes - there is a perl change which does this in the latest v8
Advanced User Guide. Look at the chapter titled 'Capturing The
Customer's IP Address With The Order'. |
|
How
do I add a manual 'continue' button onto my SSL bounce page?
Open 'ShoppingCart.pl'
in Notepad (this file is in your site directory).
Find the following code:
$sHTML = "<HTML><HEAD>\n" .
"<SCRIPT LANGUAGE='JavaScript'>\n" .
"<!-- \n" .
"function onLoad() {document.Bounce.submit();}\n" .
"// -->\n" .
"</SCRIPT>\n" .
"</HEAD>\n" .
"<BODY OnLoad='onLoad();'>\n" .
"<FORM NAME='Bounce' METHOD=POST ACTION='$sURL'>\n" .
"<INPUT TYPE=HIDDEN NAME='ACTINIC_REFERRER' VALUE='$sReferrer'>\n"
.
"<INPUT TYPE=HIDDEN NAME='COOKIE' VALUE='$sCookie'>\n"
.
"<INPUT TYPE=HIDDEN NAME='CARTCOOKIE' VALUE='$sCartCookie'>\n"
.
"<INPUT TYPE=HIDDEN NAME='SESSIONID' VALUE='$sSessionID'>\n"
.
"<INPUT TYPE=HIDDEN NAME='DIGEST' VALUE='$sBusinessCookie'>\n"
.
$sHTMLParams .
Underneath that code, add the following line:
"<br>Please wait for your browser to forward you to the
next page or click <input type=submit name='here' value='here.'>\n"
.
The space and period at the end of the line is very important.
Actinic is not able to provide any detailed support for script
changes made. If you find that there is a problem, an original
copy of the script can be found within the 'Original' folder
in your installation. Copy this into your site folder.
|
|
How
can I make the "Other Input" prompt optional?
This prompt can be made optional
by editing one of the perl scripts.
- Locate the file ActinicOrder.pm in the site folder.
- Edit the file with a text editor such as Notepad.
- Search for "sub InfoValidate", you should see…
if (length $sInfo == 0)
{
$sMessage .= ACTINIC::GetPhrase(-1, 55, "<B>$sPrompt</B>")
. "<P>\n";
}
elsif (length $sInfo > 1000)
- Comment out the first 4 lines (using #) and change the last
line so that the code reads as
#if (length $sInfo == 0)
# {
# $sMessage .= ACTINIC::GetPhrase(-1, 55, "<B>$sPrompt</B>")
. "<P>\n";
# }
if (length $sInfo > 1000)
- Save and exit.
- Update the site.
Actinic is not able to provide any detailed support for script
changes made. If you find that there is a problem, an original
copy of the script can be found within the 'Original' folder
in your installation. Copy this into your site folder.
|
|
I
want to be able to add a shopper's purchase order number to
the order confirmation email.
This article will show you how to place
your ustomers' purchase order number into the email they are
sent.
Open 'OrderScript.pl' within your site folder in Notepad.
Find the line:
$ACTINIC::B2B->SetXML('CUSTOMER_NAME',$sName);
You will find this in the sub 'GenerateCustomerMail' function.
Once you have found this line, add the following code underneath:
$ACTINIC::B2B->SetXML('PURCHASEORDERNUMBER', $::g_PaymentInfo{'PONO'});
Once you have made this change, you will be able to use the
tag <Actinic:PURCHASEORDERNUMBER/> in the 'Customer Email'
layout.
Actinic is not able to provide any detailed support for script
changes made. If you find that there is a problem, an original
copy of the script can be found within the 'Original' folder
in your installation. Copy this into your site folder.
|
|
How
can I include the selected method of shipping into the customer's
online receipt?
This will show you how to include the customer's selected shipping
class as a variable in the online receipt.
Open 'OrderScript.pl' on Notepad and search for "read the template".
It will jump to the following lines:
#
# Read the template
#
Just above this, enter the following lines:
#
# Add shipping info
#
$ACTINIC::B2B->SetXML('ShippingClass', $::s_Ship_sShippingDescription);
You can then enter <Actinic:ShippingClass/> into the 'Customer
Email' layout wherever you want the shipping method to appear.
Actinic is not able to provide any detailed support for script
changes made. If you find that there is a problem, an original
copy of the script can be found within the 'Original' folder
in your installation. Copy this into your site folder.
|
|
|
| Top |
|
|