osCommerce

UBL Omni osCommerce Payment Module

Tags:
ubl-omni-oscommerce

Last year I developed a payment module for osCommerce for Telenor’s EasyPaisa Mobile Money transfer. Since then, I was peppered with requests to develop a similar module for UBL Omni osCommerce payment module using Dukaans.

Finally last month, I found some time and developed UBL Omni payment module for osCommerce stores. This mod works in following way.

Your website shows the following information on the checkout_confirmation.php page:

1. City where customer needs to send money
2. Receiver (Your) CNIC number
3. Amount
4. It shows UBL Dukaan locator link underneath from where customer can send money.
5. Once order is received, you can send customer the email for the 16 digit reference number that you need to get payment from OMNI Dukaan.

Following are the admin panel and store front-end screens for this payment mod.

This mod can be tested here on demo store. So contact me whomever needs this mod for his website. I will provide this payment module for a price. Once I have recovered the development cost of the mod, I will eventually release it on the osCommerce website just like my previous modules and add-ons.

Cheers!

Nivo Slider as Image Slider Add-on for osCommerce Store

Tags: |
osCommerce-slideshow

Last year I developed and released an image slider add-on for osCommerce which used Easy Slider as image slider.

It turned out to be very useful add-on for community and I have removed few bugs since then. Many users asked for features such as multi-lingual support in the slider, Nivo Slider jQuery plugin as front end slider. I have combined all the feature requests into new version of the Slider, but this not a free add-on.

This osCommerce-Slider add-on will add a slideshow in your osCommerce 2.3.1 store and will add a section inside your osCommerce Admin panel under Catalog > Slideshow to manage and add slides. It will also add slider configuration panel under Configuration>Slideshow. Slider configuration panel allows you to set several parameters of Nivo Slider from the admin panel.

PHP Fatal error: Cannot redeclare do_magic_quotes_gpc() in osCommerce Store

Tags:
oscommerce-debugging

During osCommerce store customization and add-on installation, if you get following error Cannot redeclare do_magic_quotes_gpc():

PHP Fatal error: Cannot redeclare do_magic_quotes_gpc() (previously declared in /home/user/public_html/butikk/includes/functions/compatibility.php:19) in /home/user/public_html/butikk/includes/functions/compatibility.php on line 3

This error is caused by copying of a module file into the languages “catalog/includes/languages/” folder by mistake during some add-on installation. Check all the files in the add-on directories and re-upload them to their destinations. Alsi make sure you don;t mix the catalog/admin/includes/ with the catalog/includes/ folder.

Hope that helps.

Get Session Name & Session ID in osCommerce Store

Tags:

In osCommerce Store, if you ever need to get the session variable (osCsid) at any particular page or embed session variable in the link to third party payment processing website, customer session information can be accessed like this:

 
$session_link = tep_session_name ().'='. tep_session_id ();

hope that helps.

Using Form Method GET for submission on checkout_confirmation.php in Custom osCommerce Payment Module

Tags:

I recently developed a custom osCommerce Payment Module, and although I have developed payment modules for osCommerce based stores in the past, it was first time that I had to submit the form using the GET method to merchant website for further processing of the order.

The issue got further complicated due to the fact there were multiple payment modules and this could not have been hard coded in the checkout_confirmation.php file function call to draw form using tep_draw_form using get method.

After a bit of work, solution turned out to be very simple. just define a new variable form_method in the constructor class of the payment module underneath the form_action_url variable in the payment module file.

 
$this->form_action_url = 'https://secure.merchant.website-url/';
 
// set form method to use, default is post
$this->form_method = 'get';

Now you need one more addition and it’s in the catalog/checkout_confirmation.php file.

Make the following addition in the catalog/checkout_confirmation.phpfile:

Find:

 
 if (isset($$payment->form_action_url)) {
    $form_action_url = $$payment->form_action_url;
  } else {
    $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
  }

Add following:

 
  if (isset($$payment->form_method)) {
    $form_method = $$payment->form_method;
  } else {
    $form_method = 'post';
  }

Also make the following change in the same catalog/checkout_confirmation.php

 
//find this
 echo tep_draw_form('checkout_confirmation', $form_action_url, 'post'); 
 
//replace it with this 
 echo tep_draw_form('checkout_confirmation', $form_action_url, $form_method);

This will allow you to submit the form using the method of your choice. osCommerce uses only post method to submit payment information to third party merchants for procesisng, but not every merchant accepts post method for form submission, at least mine did not and which resulted in this blog post.

Hope that helps.

Cheers!

PIM-oscSlideshow1.1 – osCommerce Slideshow Gallery Add-on with Admin Panel for osCommerce 2.3.1 Store

Tags: |

PIM-oscSlideshow1.1 is the updated version for osCommerce v2.3.1. If your store is an earlier version than this, please refer to the PIM-oscSlideshow1.0 on this post.

A while back, I needed Slideshow image gallery on the home page in one of the osCommerce based store I was developing. I searched everywhere but could not find any, so I ended up developing it on my own and after lot of effort and spending some time, I have put all this together as a Contribution for community to use.

PIM-oscSlideshow will add a slideshow gallery on the home page of your osCommerce store and will add a slideshow section inside your osCommerce Admin panel under Catalog > Slideshow to manage and add slides.

Although I have developed the admin and front-end php part on my own, I have selected and used easySlider1.7 for the front end Slideshow, I take no credit for that which is entirely created by Alen – all credit to him.

if you do not want to use the easySlider as front-end slider, you can easily choose another. I have only included easySlider and jquery files this in the package for that vast majority of users who might not or can not find the required files. Any other slide show such as s3Slider or Nivo Slider can be used with this add-on. I will release another version soon with a flash front-end slideshow.

What this contribution does?

  1. Creates a slideshow on your osCommerce store front page
  2. Creates a section slideshow under Catalog inside osCommerce Admin panel
  3. I have selected easySlider as slideshow script to use with it which has lot of options on its own, but you can replace it with any other gallery script if you want.

Download Package

In this distribution, you will find the following files:

  1. slideshow.sql DB script to create “slideshow” table
  2. catalog/ – directory containing all the new files you need to upload in your store
  3. PIM-oscSlideshow v1.1 – Installation Guide – How to install PIM-oscSlideshow1.1 in osCommerce 2.3.1 store
  4. GNU GENERAL PUBLIC LICENSE.txt
  5. Instructions.txt

You can Download this PIM-oscSlideshow1.1 from osCommerce add-ons repository.

PIM-oscSlideshow1.1 Add-on Support

I wanted to create support thread on osCommerce forums, but due to time constraints, I can only check and post regularly at one place and this is why I have chosen this blog post which I have to check in any case. So for all intents and purposes, this post will become the support thread for PIM-oscSlideshow contribution.

Installation

EASY – 30 minute job!!

Just upload the files in catalog/ to their respective directories in your oscommerce store.
Also make changes in the files described in the Installation Guide for the front end and admin panel updates.

With the package, I have also provided an installation guide in pdf format, please refer to that before posting any questions.

Make sure you download the full package from the latest post (PIM-oscSlideshow1.1) on the contribution page.

Hope this Add-on will fix the issues for osc v2.3.1 store.

Cheers!

UPDATE: There’s better Slider (premium) available now which has much more features.

PIM-osCommerce-Slider add-on will add a slideshow in your osCommerce 2.3.1 store and will add a slideshow section inside your osCommerce Admin panel under Catalog > Slideshow to manage and add slides. It will also add slider configuration panel under Configuration>Slideshow. Slider configuration panel allows you to set several parameters of Nivo Slider from the admin panel.

PIM osCommerce Slider

PIM-oscSlideshow – osCommerce Slideshow Gallery Add-on with Admin Panel for osCommerce Store

Tags: | |

A while back, I needed Slideshow image gallery on the home page in one of the osCommerce based store I was developing. I searched everywhere but could not find any, so I ended up developing it on my own and after lot of effort and spending some time, I have put all this together as a Contribution for community to use.

PIM-oscSlideshow will add a slideshow gallery on the home page of your osCommerce store and will add a slideshow section inside your osCommerce Admin panel under Catalog > Slideshow to manage and add slides.

Although I have developed the admin and front-end php part on my own, I have selected and used easySlider1.7 for the front end Slideshow, I take no credit for that which is entirely created by Alen – all credit to him.

if you do not want to use the easySlider as front-end slider, you can easily choose another. I have only included easySlider and jquery files this in the package for that vast majority of users who might not or can not find the required files. Any other slide show such as s3Slider or Nivo Slider can be used with this add-on. I will release another version soon with a flash front-end slideshow.

IMPORTANT: PIM-oscSlideshow 1.0 is for osCommerce versions earlier than v2.3.1.

What this contribution does?

  1. Creates a slideshow on your osCommerce store front page
  2. Creates a section slideshow under Catalog inside osCommerce Admin panel
  3. I have selected easySlider as slideshow script to use with it which has lot of options on its own, but you can replace it with any other gallery script if you want.

Download Package

In this distribution, you will find the following files:

  1. slideshow.sql DB script to create “slideshow” table
  2. catalog/ – directory containing all the new files you need to upload in your store
  3. Installation.pdf – How to install PIM-oscSlideshow in OSC store
  4. GNU GENERAL PUBLIC LICENSE.txt
  5. Instructions.txt

You can Download this PIM-oscSlideshow from osCommerce add-ons repository.

PIM-oscSlideshow Add-on Support

I wanted to create support thread on osCommerce forums, but due to time constraints, I can only check and post regularly at one place and this is why I have chosen this blog post which I have to check in any case. So for all intents and purposes, this post will become the support thread for PIM-oscSlideshow contribution.

Installation

EASY – 30 minute job!!

Just upload the files in catalog/ to their respective directories in your oscommerce store.
Also make changes in the files described in the Installation Guide for the front end and admin panel updates.

Update 1

I had to update slideshow.php file for a missing css link. Make sure you downlaod the full package first attached with the first post and then get the updated file.

Or in the original package, you can just open catalog/includes/slideshow.php

Find:

 
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>

Add Above:

 
<link href="easy-slider.css" rel="stylesheet" type="text/css" />

That should resolve missing Slideshow styles.

It’s just one file which fixed css file path.

With the package, I have also provided an installation guide in pdf format, please refer to that before posting any questions.

Make sure you download the full package from the first post on the contribution page.

Update 2

I have been getting lot of queries about how to add images and change width and height of images in the slideshow.

Pardon me for making this not part of the Installation Guide or instructions as I over looked this thing which seemed obvious.

But first thing first, upload all the files present in the catalog folder to your store’s corresponding directories before implementing the changes in the existing osCommerce files as defined in the Installation Guide..

To Add Images in the Slideshow

You upload images using the admin panel of your store.

After installing the contribution, go to your store Admin Panel > Catalog > Slideshow and upload as many images as you want. Make sure your catalog/images/slideshow/ directory exists and writeable!

To Change Width/Height of Slideshow Gallery Images

I have set up default width to 960px and height 281px. You can change this by going into catalog/includes/slideshow.php and in the catalong/easy-slider.css.

This seemed quite obvious at the time I was putting together Installation Guide but I made mistake by assuming that every user might have some experience with css/html and could change this easily.

Hope that helps.

Cheers!

UPDATE: There’s better Slider (premium) available now which has much more features.

PIM-osCommerce-Slider add-on will add a slideshow in your osCommerce 2.3.1 store and will add a slideshow section inside your osCommerce Admin panel under Catalog > Slideshow to manage and add slides. It will also add slider configuration panel under Configuration>Slideshow. Slider configuration panel allows you to set several parameters of Nivo Slider from the admin panel.

PIM osCommerce Slider

[osCommerce] Change Currency Selection based on Payment Module on checkout_confirmation page in osCommerce Store

Tags:

In osCommerce store which has been set up to accept payment using multiple payment modules, there are chances that you might want to accept payments in specific currencies based on payment methods. Not every payment method support all currencies.

You can change currency based on payment module selection by adding few lines of code on your checkout_confirmation.php page. Following sample code shows how you can achieve that.

Open catalog/checkout_confirmation.php page and add following code below
this require(‘includes/application_top.php’); line.

 
 require('includes/application_top.php');
 
if ($HTTP_POST_VARS['payment'] == 'paypal') {
//select GBP for paypal method
     $currency = 'GBP';
  }elseif ($HTTP_POST_VARS['payment'] == 'payway') {
  //select Aus Dollar for payway method  
 $currency = 'AUD';
  }elseif ($HTTP_POST_VARS['payment'] == 'alertpay') {
  //select Euro for alertpay method  
 $currency = 'EUR';
  }else{
//for all of the rest US dollars
     $currency = 'USD';
  }

Just make sure that you have added all those currencies in your store before you attempt to set them on your checkout_confirmation page using above method.

Hope that helps.

Cheers!

[osCommerce] How To Check if the Customer is Logged in or not in osCommerce Store

Tags:

While working in osCommerce store, there are many places where you want to show some infromation only to logged in customers, and some thing else to non-logged in users. For this purpose, you need to check tep_session_is_registered(‘customer_id’) variable and show different blocks of content.

In the following code, I have put togther an example where user is shown login link if he’s not logged in, and My Account, Checkout, Shopping Cart and Logoff links if he’s logged in.

 
$nav = '<ul id="nav">';
 
if (tep_session_is_registered('customer_id')) 
$nav .= '<li> <a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">Logoff</a></li>
           <li> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">Checkout</a></li>
          <li><a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">View Cart</a></li>
          <li><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">My Account</a></li>'; 
 
else $nav .= '<li><a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">Login</a> </li>';
 
$nav .= '</ul>';
 
echo $nav ;

Hope that helps.

Cheers!

[osCommerce] Resolve osCommerce Admin Panel Product Attributes Page Navigation Problem

Tags:

In the osCommerce Admin Panel, if you are having problem navigating to next page, 2nd, 3rd or so on, in the Products Attributes Page, following two lines will fix that issue and you will be able to navigate to next pages.

Open products_attributes.php in the catalog/admin/ directory.

 
//Find this code on line 16 or so
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
 
//Add following code above that line
 
$value_page = $_REQUEST['value_page'];
$attribute_page = $_REQUEST['attribute_page'];

The issue is caused when register_globals is disabled.

In PHP 4.1.0 the superglobal $_GET array was introduced and $_GET and $_POST officially replace $HTTP_GET_VARS and $HTTP_POST_VARS respectively. $HTTP_GET_VARS and $HTTP_POST_VARS are deprecated now.

Hope that helps.

Cheers!