Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to change?


peteravu

Recommended Posts

Posted

I can't find out how I manual select what currencies I like to show in the dropdown menu in catalog\includes\boxes\currencies I like to hide the default currency (but still use it as the basic for the selling price).

Do I have to change the $key to USD, AUD or 4, 7 (id) ???

 

With other words I like to keep the default currency but hide it in the shop.

<?php
/*
 $Id: currencies.php,v 1.16 2003/02/12 20:27:31 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 if (isset($currencies) && is_object($currencies)) {
?>
<!-- currencies //-->
         <tr>
           <td>
<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_CURRENCIES);

   new infoBoxHeading($info_box_contents, false, false);

   reset($currencies->currencies);
   $currencies_array = array();
   while (list($key, $value) = each($currencies->currencies)) {
     $currencies_array[] = array('id' => $key, 'text' => $value['title']);
   }

   $hidden_get_variables = '';
   reset($HTTP_GET_VARS);
   while (list($key, $value) = each($HTTP_GET_VARS)) {
     if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
       $hidden_get_variables .= tep_draw_hidden_field($key, $value);
     }
   }

   $info_box_contents = array();
   $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
                                'align' => 'center',
                                'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());

   new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- currencies_eof //-->
<?php
 }
?>

Posted

It must be possible to do something like this http://www.oscommerce.com/forums/index.php?showtopic=125269

If there are a lot of products, and as you say, you may want to keep them in the database, you can simply add a column to the manufacturers table, something like:

 

disable_manufacturer

boolean

default value of zero

 

1. Set the value of the column to '1' for the said manufacturer.

 

2. Then when the manufacturers dropdown is done, check for the flag, just something like, a bit of pseudo code.

 

---------------------------------

 

if (!disable_manufacturer) {

include manufacturer in the dropdown list

}

 

---------------------------------

 

3. Then when displaying products, much the same code to be inserted.

 

I personally don't like "if not' statements, much cleaner like this .............

 

----------------------------

 

if (disable_manufacturer) {

} else {

include product

}

 

-----------------------------

I add a column in the currencies table called disable_currency

 

But where and how to write the code?

 

Just need to get it out of the dropdown list.

Posted
It must be possible to do something like this http://www.oscommerce.com/forums/index.php?showtopic=125269

 

I add a column in the currencies table called disable_currency

 

But where and how to write the code?

 

Just need to get it out of the dropdown list.

 

 

I use this in my header:

 

basically it displays all languages (flags) in my header except the active one.

Treasurer MFC

Posted
I use this in my header:

 

basically it displays all languages (flags) in my header except the active one.

 

 

forgot this :

 

<?php

if (!isset($lng) || (isset($lng) && !is_object($lng))) {

include(DIR_WS_CLASSES . 'language.php');

$lng = new language;

}

 

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

$languages_string = ' | ';

reset($lng->catalog_languages);

while (list($key, $value) = each($lng->catalog_languages)) {

if ($language != $value['directory'] ){

$languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a>';

}

}

echo $languages_string . '  ';

}

else {

echo '  ';

}

?>

Treasurer MFC

Posted

Maybe something like this but it don?t work

 

    $hidden_get_variables = '';
   reset($HTTP_GET_VARS);
   while (list($key, $value) = each($HTTP_GET_VARS)) {
     if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') && ($key != " where currencies_disable_currency = '1') ) {
       $hidden_get_variables .= tep_draw_hidden_field($key, $value);
     }
   }

Posted
forgot this :

 

<?php

if (!isset($lng) || (isset($lng) && !is_object($lng))) {

    include(DIR_WS_CLASSES . 'language.php');

    $lng = new language;

  }

 

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

  $languages_string = ' | ';

  reset($lng->catalog_languages);

  while (list($key, $value) = each($lng->catalog_languages)) {

    if ($language != $value['directory'] ){

      $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a>';

    }

  }

  echo $languages_string . '  ';

}

else {

  echo '  ';

}

?>

I don't understand how to use the code in the currency drop down?

Posted

I still think this is a way to go, but how to do?

It must be possible to do something like this http://www.oscommerce.com/forums/index.php?showtopic=125269

 

I add a column in the currencies table called disable_currency

 

But where and how to write the code?

 

Just need to get it out of the dropdown list.

Posted
I still think this is a way to go, but how to do?

 

 

go to the currencies box:

 

this code :

 

$currencies_array = array();

while (list($key, $value) = each($currencies->currencies)) {

$currencies_array[] = array('id' => $key, 'text' => $value['title']);

}

 

try something like:

 

$currencies_array = array();

while (list($key, $value) = each($currencies->currencies)) {

if ($key != 'USD') {

$currencies_array[] = array('id' => $key, 'text' => $value['title']);

}

}

 

give it a try.

 

never grasped why you would want to do this in the first place.

Treasurer MFC

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...