FPHPSC Customize

From FreeBert Wiki

Jump to: navigation, search

[edit] Customizing The Free PHP Shopping Cart to better match your site's look & style


There are a number of ways you can customize the look of your Free PHP Shopping Cart, to better blend the cart pages in the basic look & style of the rest of your site.
Firstly, you can choose an alternate .CSS file (in the Local_Settings.php file) to change between looks of your site.
Alternatively you can edit the active .CSS file to change specific elements, color schemes and other visual properties.
The cart package contains two files, Overall_Header.php and Overall_Footer.php (located in the script's /inc/skin/ directory) that are included in every visible cart page. They are a good place to add site logos and links to help the cart fit seamlessly into your site's main design.
Finally, if you are PHP savvy, you can edit the actual codes and functions in the cart pages, taking complete control of the look, feel and function of your cart. Be careful if/when editing PHP pages - a single misplaced quote or semi-colon could stop the functioning of your entire cart!

[edit] Further Customization

[edit] Changing The Currency Displayed

(Problem resolved in Latest Version Released: V0.70 - December 11, 2007) A question sent in from email asked:
I have changed the Paypal to GBP currency and have edited the Total in the ShoppingCart.php to read (GBP) but I cannot find where I can change the $ sign in front of the actual amount to a £ sign.
Answer:
As mentioned in the question, if you want to change the currency of the shopping cart, you need to make sure you change all parts which use the currency. If you are using it, the PayPal payment mod will need to be changed to let PayPal know what currency you are using. And, in addition to the currency symbol itself, there is a currency title used by the shopping cart. It is also found in the Cart_Functions file and can be easily found and replaced to the title of the currency of your choice.

Support to include a setting for currency title and symbol have been added to the to do list for the next release.

For now, you can manually change the $ to the £ fairly easily using any text editor that allows text seach or find or replace:

  • Open the Cart_Functions.php page (located in the inc/functions folder)
  • Search/Find in that document all instances of "$ '." - (only what is between the "", don't include the "" in your search - to be explicit, that is a dollar sign, a space, a single quote, and a period)
  • Replace each instance you find with "£ '." - (again, only what is between the "" - as you can see, replacing the $ with your £.)

By my count, there are 7 instances of the above string that you will find & replace. That’s it. Save and upload your file.

Why search for that (a dollar sign, a space, a single quote, and a period)? As you can see, PHP uses a lot of dollar signs in its code, so searching / replacing all dollar signs will corrupt the code. By searching for that string, you will find all and only the Dollar Signs that are being displayed to represent the currency.

UPDATE: There are more actually more places that require updating in regards to the currency change. The issue of setting a currency symbol ($) and currency code (USD) is resolved in Latest Version Released: V0.70 - December 11, 2007. Simply set the value you desire for the symbol and currency code in the local settings file.

Personal tools
Toolbox