- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
osCommerce. How to put a site into catalog mode
February 13, 2015
This tutorial shows how to put osCommerce site into catalog mode.
osCommerce. How to put a site into catalog modeRemoving Add to cart button
-
By default, osCommerce does not have catalog mode. That’s why you should edit files in order to put web site into catalog mode. Basically, you should remove all Add to cart buttons in order to get rid of shopping cart functionality. Inspect add to cart button using browser built-in inspector or using Firebug plugin in Firefox browser. We can see that Add to cart button has ui-button-text class (please note that the class name depends on the template). We will use this class in order locate the appropriate code in osCommerce files. Click Find All:
-
Open editor that can search code in multiple files and folders. We are going to use Notepad++ editor. Press Ctrl+F in order to open search dialog, open Find in Files tab. Specify the class name in Find what field. Select folder with osCommerce files in Directory section (make sure that template files are unizipped). Make sure that you have the same options as on the screenshot below. Click Find All:
-
We can see the search results. Skip files with .css and .js extensions. You should perform changes in .php files. Basically, most changes should be performed to files in includes\modules folder, includes\modules\boxes and inside catalog folder (root folder of oscommerce):
-
We are going to show you the way how changes should be performed. Open includes\modules\new_products.php file by clicking on appropriate line of code. We can see class of Add to cart button (class="ui-button-text"). In our case Add to cart button has the following structure of code:
1$p_buy_now_text
=
''
.tep_draw_button_top() .
'<a href="'
.tep_href_link(" products_new.php
","
action=
"buy_now&products_id=".$p_id).'""
class
=
""
><span
class
=
"ui-button-text"
>'. IMAGE_BUTTON_IN_CART .
'</span></a>'
. tep_draw_button_bottom().
''
;
Remove this code, save changes and upload the modified code to server. Screenshot shows what code should be removed:
Button was removed from New products module:
-
Let’s remove the button from product page. In order to do so, file product_info.php should be modified. Remove code, save changes and upload the modified file:
We have removed Add to cart button from product page:
-
We are going to remove Add to cart button from category page. Open \includes\modules\product_listing.php file. Remove the appropriate code (in our case several instances of add to cart button were specified):
We have removed Add to cart button from category page:
-
For pages like new products, specials changes should be performed in files like products_new.php, specials.php. You can find those files in the root folder of Oscommerce. Location of appropriate code depends on template and template modules. You may perform changes to the rest of the files in the same way. Please check video version of tutorial. There you will see more detailed information on how to put osCommerce site into catalog mode.
Removing prices
-
Inspect price using browser built-in inspector or using Firebug plugin in Firefox browser:
-
You should perform changes to files in which you have removed Add to cart button. Please check Removing Add to cart button section above. Search code by class, in our case class is productSpecialPrice. Please check code of includes\modules\new_products.php file. The highlighted code should be removed. Please note that code in your template may have another structure:
-
Remove appropriate code in \includes\modules\boxes\bm_specials.php file:
-
Remove code in product_info.php file:
-
Remove code in includes\modules\product_listing.php file:
-
Remove code in products_new.php file:
-
Remove code in specials.php file:
-
You may perform changes to the rest of the files in the same way. Please check video version of tutorial. There you will see more detailed information on how to put osCommerce site into catalog mode.
-
We have removed prices:
Removing Shopping cart
-
Now we should remove Shopping cart. In our template shopping cart is provided by Shopping Cart in Header module:
-
Open admin section and go to Modules->Boxes. Click on the module:
-
Remove the module:
-
We have removed shopping cart module:
Feel free to check the detailed video tutorial below:
osCommerce. How to put a site into catalog mode