jump to navigation

Fedex , osCommerce and Godaddy Hosting January 17, 2008

Posted by admin in : Simple Issues , add a comment

One of our clients was facing issue with the FedEx Module in osCommerce.

The site was running on Godaddy Hosting.

We disabled Fedex. Then in Fedex1.php, we changed the part that references godaddy to:

curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt($ch, CURLOPT_PROXY, “http://proxy.shr.secureserver.net:3128″);

Then enable the module again, and did a rate request, and that’s it.

Cheers !

Default country dropdown lists in oscommerce November 18, 2007

Posted by admin in : Simple Issues , add a comment

A client had this query… 

How to change the country dropdown lists to default to a specific country. As you know hey default to aphabetical order. I want to be able to have United States to be listed out of order at the top of the list with the others in the normal order. Is this a php edit or a SQL edit and where and how would it be done?

Solution :

You can also make any country appear by default while still having the pull down list available.

In includes/functions/html_output.php at about line 299 find:

$countries_array = array(array(’id’ => ”, ‘text’ => PULL_DOWN_DEFAULT));

Replace (for the United States) with…

// $countries_array = array(array(’id’ => ”, ‘text’ => PULL_DOWN_DEFAULT));
$countries_array = array(array(’id’ => ‘223′, ‘text’ => ‘United States’));

You can change the country id and the text in this line to make any country appear by default.

Cheers !

username and password in welcome email of oscommerce July 5, 2007

Posted by admin in : Simple Issues , add a comment

One of our clients wanted this small thing to be achieved. They wanted the USERNAME And PASSWORD to be shown on the welcome email that an user while registering in an eshop

Here are the steps :

2. Open the create_account.php (catalog/) and :

Change the code FROM:

$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

TO:

$email_text .= EMAIL_WELCOME . EMAIL_USERNAME . EMAIL_PASSWORD . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

open the language file create_account.php
(usually in /languages/english, but may need to open other languages if using other languages):

Find the code:
define(’EMAIL_WELCOME’, ‘Welcome to <b>’ . STORE_NAME . ‘</b>.’ . “\n\n”);

Add after that code:
define(’EMAIL_USERNAME’, ‘Your username is: ‘ . stripslashes($HTTP_POST_VARS[’email_address’]) . “\n\n”);
define(’EMAIL_PASSWORD’, ‘Your password is: ‘ . stripslashes($HTTP_POST_VARS[’password’]) . “\n\n”);
Thats it !

Lightbox for osCommerce ! May 25, 2007

Posted by admin in : Simple Issues , add a comment

Fed up with the default option given by osCommerce to enlarge product images, one of the client wanted to implement Lightbox (http://www.huddletogether.com/projects/lightbox/)

Lightbox JS is a simple, unobtrusive script used to overlay images on the current page. It’s a snap to setup and works on all modern browsers.

We took it up and made the changes. It worked like breeze

############################################################

First upload the files that are included with this package to the root directory of your catalog.

Typically the catalog directory.
############################################################

Secondly you will add the following code between the <head> and </head> to any page that you want to use the script on.

Typically on catalog/product_info.php

<script type=”text/javascript” src=”js/prototype.js” mce_src=”js/prototype.js”></script>
<script type=”text/javascript” src=”js/scriptaculous.js?load=effects” mce_src=”js/scriptaculous.js?load=effects”></script>
<script type=”text/javascript” src=”js/lightbox.js” mce_src=”js/lightbox.js”></script>

thirdly if you want to use this contrib on the catalog/product_info.php page you will change

<script language=”javascript”><!–
document.write(’<?php echo ‘<a href=”java script:popupWindow(\\\” . tep_href_link(FILENAME_POPUP_IMAGE, ‘pID=’ . $product_info[’products_id’]) . ‘\\\’)”>’ . tep_image(DIR_WS_IMAGES . $product_info[’products_image’], addslashes($product_info[’products_name’]), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ‘hspace=”5″ vspace=”5″‘) . ‘<br>’ . TEXT_CLICK_TO_ENLARGE . ‘</a>’; ?>’);
//–></script>
<noscript>
<?php echo ‘<a href=”‘ . tep_href_link(DIR_WS_IMAGES . $product_info[’products_image’]) . ‘” target=”_blank”>’ . tep_image(DIR_WS_IMAGES . $product_info[’products_image’], $product_info[’products_name’], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ‘hspace=”5″ vspace=”5″‘) . ‘<br>’ . TEXT_CLICK_TO_ENLARGE . ‘</a>’; ?>
</noscript>

with

<?php echo ‘<a href=”‘ . tep_href_link(DIR_WS_IMAGES . $product_info[’products_image’]) . ‘” rel=”lightbox”>’ . tep_image(DIR_WS_IMAGES . $product_info[’products_image’], $product_info[’products_name’], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ‘hspace=”5″ vspace=”5″‘) . ‘<br>’ . TEXT_CLICK_TO_ENLARGE . ‘</a>’; ?>
<noscript>
<?php echo ‘<a href=”‘ . tep_href_link(DIR_WS_IMAGES . $product_info[’products_image’]) . ‘” target=”blank”>’ . tep_image(DIR_WS_IMAGES . $product_info[’products_image’], $product_info[’products_name’], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ‘hspace=”5″ vspace=”5″‘) . ‘<br>’ . TEXT_CLICK_TO_ENLARGE . ‘</a>’; ?>
</noscript>

############################################################

lastly
add contents of lightbox.css to the bottom of catalog/stylesheet.css

Problem with setting default language ! May 8, 2007

Posted by admin in : Simple Issues , add a comment

A customer faced this pecuiliar issue.

” Whatever I set as  Default Language in ADMIN, it is override by the browser..can you help..? ”

Solution :

We just changed the code at file: …/includes/application_top.php

At line +/- 274
from:
CODE
if (isset($HTTP_GET_VARS[’language’]) && tep_not_null($HTTP_GET_VARS[’language’])) {
$lng->set_language($HTTP_GET_VARS[’language’]);
} else {
$lng->get_browser_language();
}

to:
CODE
if (isset($HTTP_GET_VARS[’language’]) && tep_not_null($HTTP_GET_VARS[’language’])) {
$lng->set_language($HTTP_GET_VARS[’language’]);
} else {
$lng->set_language(DEFAULT_LANGUAGE);
}

Simple !