Please DO NOT change or delete any PHP codes unless you know PHP well enough.
I make no guarantees that any of the codes or ideas listed in this manual will work for
everyone. Most are just meant to be starting points or examples. Please make
backups of all files before you start making changes.
Also...you can simply edit/convert the categories and products
already in the demo store over to your new categories and products. You
don't need to delete them first.
To get rid of the yellow horizontal rule that appears on each page displayed near the top of your main shop page (above Welcome to Washupito's....), edit the
following code in modules/templates/s_header.ihtml:
index.ihtml - Controls the look of the mid section of your homepage and 'Featured
Items' list to the right hand side. This is also where you can delete the
words 'Welcome to Washupito's...'
leftmenu.ihtml - Controls the look of the left menu where
categories, search box, etc. are displayed. You will also need to change the
leftmenu.ihtml in the 'modules/account/html' and 'modules/checkout/html'
folders to be coded exactly like this one.
An easy way to cut down maintenance is to "include" the shop's leftmenu.ihtml file in the account and checkout leftmenu files. That way, you only have one file to modify and the change is seen in all three modules. Replace the html in checkout/html/leftmenu.ihtml and account/html/leftmenu.ihtml with this (backup your existing leftmenus first...) :
<?php
// include shop's leftmenu
include MODROOT."/shop/html/leftmenu.ihtml";
?>
CREDIT: nhyde
browse.ihtml - Controls the look of the page that lists all the products in
a particular category. So lets say you have a category 'hats'. When I click
on the 'hats' link in the left menu it will take me to a page (browse.ihtml)
that displays all of the products in the 'hats' category. (Want a 2 column browse or need an "add to cart" form on your browse page? I have been asked quite a few times for my browse page code, so..... download my browse page here.)
flypage.ihtml - Controls the way your products are displayed when a
visitor wants to view an individual product after clicking on a product
listed in the 'browse.ihtml' page.
cart.ihtml - Controls the area of space above and below your shopping cart.
It holds the checkout button the customer presses to checkout after viewing
their shopping cart.
login.ihtml - Controls the look of the login and registration form.
I have been asked quite a few times for my browse page code (it has 2 column browse and "add to cart" code), so if you want to, you may download my browse page from here.
If you want a different flypage for a particular category (to create a different background or accompanying text for certain
categories, etc.), you can create a new flypage by editing the default flypage 'flypage.ihtml' to meet your needs and renaming it to something different.
For example, if you want a different look for your the pages in your Garden category, you might create a file named
'garden_flypage.ihtml' and put it in the 'shop/html' directory.
You would then go to the Admin section, click the 'Products' link, then 'List Categories', click the category you want to use the new flypage, and lastly type the name of the new flypage path into the field 'Category Flypage'. In this example the path would be 'shop/garden_flypage'. Notice we do not include /html/ in the path or the extension .ihtml.
index.ihtml - The first page after a customer clicks the checkout button. They select shipping address here. If you don't like the way the shipping section looks you will need to edit the file 'shipping.ihtml' in this same
folder. The other files in this folder that deal with shipping are to be used if you have the InterShipper enabled.
If the thank you page is not appearing you will need to edit '/modules/checkout/html/thankyou.ihtml' by replacing the 3 lines of code at the top (beginning with $q) with the following 4 lines:
2.) Name the file using the extension .ihtml ---> example: shipping_fees.ihtml
3.) Upload the file to a phpShop directory of your choice. ---> example: phpshop/modules/shop/html
4.) Add the link for your new page to the page of your choice (A good
example page to add your new link to would be: phpshop/modules/templates/s_header.ihtml) using the following link code as
an example:
By looking at the URL we can see that "shop" is the directory the file is located in and "shipping_fees" is the file itself. Notice that we do not include the .ihtml extension. Be sure to leave that off in the link.
5.) That's it. Your page will include the header, footer, etc. already when
it the link is opened, just as any other phpShop page would. =)
Want to get rid of the extra spacing in your checkout 'select shipping address' table so the options will be next to the checkbox instead of an inch away?
Open '/modules/checkout/lib/ps_checkout.inc' and edit the 'ship to address radio' function. I will
just paste the entire function here with the table edited.
/************************************************************************
name: ship_to_address_radio()
** created by: gday
** description: Get all the user_info Ship To (ST) records associated
** with the $user_id and print an HTML radio check box
** form element using the retrieved data.
** parameters: $user_id - user id of to display ship to addresses
** $name - name of the HTML radio element
** $value - If matched, then this radio item will be
** checked
** returns: Prints html radio element to standard out
***************************************************************************/
function ship_to_addresses_radio($user_id, $name, $value) {
global $sess;
$db = new ps_DB;
/* Select all the ship to information for this user id and
* order by modification date; most recently changed to oldest
*/
To change the way the e-mail receipt looks, look in the function named
'email_receipt()' listed in the '/modules/checkout/lib/ps_checkout.inc'
file. Just be very careful with it.
Question - In the Administration section, all of the image links are broken?
The links are all pointing to: http://www.mysite.com/ps_image/whatever.gif - instead of: http://www.mysite.com/shop/ps_image/whatever.gif
To fix that just copy the 'ps_image' directory out of the 'shop' directory, and into your main level
web directory....so that the link http://www.mysite.com/ps_image/whatever.gif will work.
Do not delete 'ps_image' from the 'shop' directory completely - You may want to leave the 'ps_image/vendor' directory inside of your 'shop' directory if you plan on using the vendor image upload formlocated in the admin area. That will still be pointing to http://www.mysite.com/shop/ps_image/vendor/vendor.gif.
Question - I would like the country order (in registration) to be as follows:
United States
Canada
etc.
etc.
Answer -
Step 1.) Change 'database country_id' in the MySQL database (this is where PhpMyAdmin would come in
handy) to the number you want.
Example: Change USA to 1 if you want it to appear first on the drop down list.
Step 2.) Edit 'function list_country' in 'admin/lib/ps_html.inc' to:
function list_country($list_name, $value="") {
$db = new ps_DB;
$q = "SELECT * from country ORDER BY country_id ASC";
$db->query($q);
echo "<SELECT NAME=$list_name>\n";
echo "<OPTION VALUE=\"\"> - </OPTION>\n";
while ($db->next_record()) {
echo "<OPTION VALUE=" . $db->f("country_id");
if ($value == $db->f("country_id")) {
echo " SELECTED";
}
echo ">" . $db->f("country_name") . "</OPTION>\n";
}
echo "</SELECT>\n";
return True;
}
CREDIT: Ron (Narwilly)
Added 3/22/2002: If that does not work properly for you, please try using the code above, but instead of:
First you need to open 'modules/checkout/lib/ps_chekcout.lib' and edit the
function 'calc_order_shipping()'.
My shipping function (for example only-edit as needed) is as follows:
/************************************************************************
name: calc_order_shipping()
** created by: pablo
** description: Calculate the shipping charges for the current order
** parameters: $d
** returns: Shipping costs for this order
***************************************************************************/
function calc_order_shipping($d) {
eval(load_class("ISshipping", "ps_intershipper"));
$ps_intershipper= new ps_intershipper;
if (IS_ENABLE) {
if(!($shipping = $ps_intershipper->fetch_quote($d)))
return(0);
reset($shipping);
while (list($key,$val)=each($shipping)) {
if (strcmp(trim($key),trim($d["ship_method_id"])) == 0)
$quote = $shipping[$key]["rate"];
}
return($quote);
}
else {
//fetch the subtotal of the order, this is the cost of the goods exclusive
of tax etc.
$order_subtotal =$this->calc_order_subtotal($d);
If subtotal is $1.00 to $14.99 - Shipping is $6.60
If subtotal is $15.00 to $34.99 - Shipping is $8.60
If subtotal is $35.00 to $59.99 - Shipping is $10.60
If subtotal is $60.00 to $89.99 - Shipping is $12.60
If subtotal is $90.00 to $100.00 - Shipping is $14.60
If subtotal is $101.00 to $150.00 - Shipping is $16.60
If subtotal is $151.00 or more - Free Shipping (plus $1.65 handling fee)
Intershipper will need to be turned off. This is done in your 'etc/phpShop.cfg' file at the the line:
#InterShipper Directives
#yadda yadda
"IS_ENABLE" => "0",
Setting IS_ENABLE to 0 means it is off. Set to 1 and it is on...
You may also need to edit your ro_basket file. (phpshop/modules/templates/ro_basket.ihtml)
Take this code from that file:
If you are looking for a phpShop web host, please consider Arias Web Hosting. We offer multiple domain Linux hosting and our pricing is very affordable.
Good luck with your shop,
Amanda Arias
Thank You's
Special thanks to everyone on the boards who directly or indirectly helped me, including - in no particular order - Nathan (nhyde), Simon (spb), Brett, JohnS, heiko, narwilly, Kelly Meeks, dab, TopoGijo, Derrick Wooden, Steve (aka Recoil), Gord Fisch, and Brian S.