Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Get 1 Free


kymation

Recommended Posts

Hi

 

I have just installed the contribution and found the installation seemless thanks to the very good install instructions.

 

One question:

 

1) Is there anyway of changing 'x amount of free products per ORDER' to 'x amount of free products per CUSTOMER'. ie customers don't get given a free product on repeat orders of the original order.

 

Many Thanks

 

Tim

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...

Has anyone coded up an infobox to show products with a Get X Free offer ?

I know it is not that hard to do, but thought if someone has already ...

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

  • 1 month later...

Hi All - great contrib, seems to work so far perfectly but I am baffled by one major thing, the latter "full versions" have this in the install instructions:

 

==========

New Files:

==========

 

The following code files are new with this package:

 

catalog/admin/get_1_free.php

catalog/admin/includes/languages/english/get_1_free.php

catalog/admin/includes/functions/get_1_free.php

catalog/includes/functions/get_1_free.php

 

However, none of the full versions of this contrib have the "new" file : catalog/admin/includes/functions/get_1_free.php included, I cannot find this file anywhere in any of the downloads of this contrib.

 

 

I went ahead and installed the contrib and it seems to work but whats with this missing file? Is this going to work without it?

 

Anybody know?

 

Thanks!

 

Jacson

Link to comment
Share on other sites

You only need it if the Admin fails without it. I don't believe that it does, but I haven't tried it. If you do need it, the file should be just a copy of the one from the Catalog side.

 

It looks like I'm going to have to try to find the time to go clean this thing up. Someday.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 2 months later...

Hi,

Curious about this addon as im doing a buy 2 get 1 free promotion on my site and seeing if this will do the job.

I havea category, and if a user buys 3 of the products within in, 1 of thoes products will be for free, the one that is the least price of course.

 

Heres the promo text, "Buy 2 get 1 free, of equal or lesser value"

 

Thanks

Link to comment
Share on other sites

Hello i hope somebody can read my post eventough this is an old mod..

 

i am using this adon..

 

the problem is i am using another product which i put into zero?

 

i would like to hide the product so it wont show on product list and bestseller and if itl be opened i would like to disable the add to cart and buy now button? its troubling me coz it shows up in the best seller i have it appearing on on all of my product as buy 1 take one?

any sugested mod?

 

0

Link to comment
Share on other sites

Hello i hope somebody can read my post eventough this is an old mod..

 

i am using this adon..

 

the problem is i am using another product which i put into zero?

 

i would like to hide the product so it wont show on product list and bestseller and if itl be opened i would like to disable the add to cart and buy now button? its troubling me coz it shows up in the best seller i have it appearing on on all of my product as buy 1 take one?

any sugested mod?

 

0

Hi

 

in checkout_process.php

 

find

 //   comment out the next line if you don't want free products in the bestseller list
     tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $free_product['quantity']) . " where products_id = '" . tep_get_prid($free_product['id']) . "'");

 

now change it too

 //   comment out the next line if you don't want free products in the bestseller list
 //    tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $free_product['quantity']) . " where products_id = '" . tep_get_prid($free_product['id']) . "'");

 

it will no longer be added to best sellers to remove it from best sellers table use phpmyadmin click on products table find products_ordered filed for that product now click on the pencil icon and edit it

 

Steve

Link to comment
Share on other sites

Hi,

Curious about this addon as im doing a buy 2 get 1 free promotion on my site and seeing if this will do the job.

I havea category, and if a user buys 3 of the products within in, 1 of thoes products will be for free, the one that is the least price of course.

 

Heres the promo text, "Buy 2 get 1 free, of equal or lesser value"

 

Thanks

Hi,

 

This is buy x amount get y amount free, you have to assign what product will be free in admin, user cant buy 1 product and get any product he chooses of same amount or less free

 

Steve

Link to comment
Share on other sites

Hello good people of the planet OSC!

 

Thanks for this mod Kymation

 

Is there any way to somehow enable the free product to have colour / style / size selection capability?

 

At the moment - I am asking people to tell me what style and colour of the freebie they want in the comments box, but of course, this is pretty annoying as some people forget or choose an option that's out of stock!

 

Anyone know a way to achieve this?

 

Thanks

Link to comment
Share on other sites

Hi,

 

This is buy x amount get y amount free, you have to assign what product will be free in admin, user cant buy 1 product and get any product he chooses of same amount or less free

 

Steve

 

Ah ok, thanks steve. Any idea of a contrib that allows me to do that?

ive been looking around for a while no with no avail.

Link to comment
Share on other sites

Ah ok, thanks steve. Any idea of a contrib that allows me to do that?

ive been looking around for a while no with no avail.

There s no contribution that i know, off get 1 free could be altered to do that, but you would have to hire a php coder for that

 

Steve

Link to comment
Share on other sites

Hi

 

in checkout_process.php

 

find

 //   comment out the next line if you don't want free products in the bestseller list
     tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $free_product['quantity']) . " where products_id = '" . tep_get_prid($free_product['id']) . "'");

 

now change it too

 //   comment out the next line if you don't want free products in the bestseller list
 //    tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $free_product['quantity']) . " where products_id = '" . tep_get_prid($free_product['id']) . "'");

 

it will no longer be added to best sellers to remove it from best sellers table use phpmyadmin click on products table find products_ordered filed for that product now click on the pencil icon and edit it

 

Steve

thaaaannnkkksss!!!!

Link to comment
Share on other sites

Hi

 

in checkout_process.php

 

find

 //   comment out the next line if you don't want free products in the bestseller list
     tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $free_product['quantity']) . " where products_id = '" . tep_get_prid($free_product['id']) . "'");

 

now change it too

 //   comment out the next line if you don't want free products in the bestseller list
 //    tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $free_product['quantity']) . " where products_id = '" . tep_get_prid($free_product['id']) . "'");

 

it will no longer be added to best sellers to remove it from best sellers table use phpmyadmin click on products table find products_ordered filed for that product now click on the pencil icon and edit it

 

Steve

 

whoaahh sorry but its not on my file

// comment out the next line if you don't want free products in the bestseller list

tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $free_product['quantity']) . " where products_id = '" . tep_get_prid($free_product['id']) . "'");

 

this part.. now i got some problems the orders.php record the order but the details of the customer is not there just the price and postage.. when i looked at the database its there what part of the installation could have caused this..

 

testco.png

Link to comment
Share on other sites

  • 4 weeks later...

I'm having a strange issue with this contribution and I expect it has something to do with the MVS shipping mod I also have installed. Everything works on the customer's end, it adds the free item, the item shows up properly all through the checkout process and even on the customer's order confirmation email, however when I view the order on the admin side it does not show the free item as part of the order at all, not on the order, the invoice or the packing slip. The only thing that it shows the customer ordered is the item they would have paid full price for. Has anyone else encountered this issue? Any insight as to where I might look to fix this?

 

When I look at the database the free item is there as part of the order, but the admin is not reflecting it.

Link to comment
Share on other sites

It sounds like you have an error of some kind in your Admin code. The product should show up if it's in the database. I have this installed in a store with MVS and it works fine. You'll just have to follow the data from the database to your Admin pages.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 3 months later...

Hello !

I think that it's better to say the customer that it's an offer for this item, that into all listings.

So i have this script into catalog/product_listing.php:

 

if(tep_db_num_rows(tep_db_query("select products_id, get_1_free_expires_date, status from " . TABLE_GET_1_FREE . " where products_id = '" . (int)$listing['products_id'] . "' and get_1_free_expires_date>now() and status = '1'")))
{
 $lc_text .= '<span style="color:#ee5500; font-weight:bold;">'.TEXT_GET_1_FREE_PUB.'</span>';
}
           break;

and a similar into catalog/products_new.php with adaptation for the variables names ($products_new['products_id'] & $products_new['name'] instead $listing['products_id'] & $lc_text respectively

 

I have put TEXT_GET_1_FREE_PUB define into catalog/includes/languages/french/index.php :

define('TEXT_GET_1_FREE_PUB', '<br>En ce moment, un Cadeau !');

that you can translate easely into your language & put it into catalog/includes/languages/<your language>/index.php

 

In the same way, i have modified catalog/product_info.php & catalog/includes/languages/french/product_info.php to give last date:

    if (tep_db_num_rows($get_1_free_query) > 0) {
     $free_product = tep_db_fetch_array($get_1_free_query);
       $exp=explode('-',substr($free_product['get_1_free_expires_date'], 0, strpos($free_product['get_1_free_expires_date'], ' ')));
       $jour=$exp['2'];
       $mois=$exp['1'];
       $an=$exp['0'];
     echo '<p>' . sprintf (TEXT_GET_1_FREE_PROMOTION, $free_product['products_qualify_quantity'], $product_info['products_name'], $free_product['products_free_quantity'], $free_product['products_name'],$jour,$mois,$an) . '</p>';
   }
// end Get 1 Free

french define:

// Get 1 Free
define('TEXT_GET_1_FREE_PROMOTION', '<span style="color:#ee5500; font-weight:bold;">Offre Spéciale limitée:<br>Acheté : %u %s<br>Cadeau :  %u %s Gratis ! <br></span><span style="text-decoration:underline;">ATTENTION </span>: Offre valable jusqu\'au <span style="font-weight:bold;">%s/%s/%s !</span>');

that you can translate easely into your language & put it into catalog/includes/languages/<your language>/index.php.

Keep care to the %s for the dates (Y/m/d in english, d/m/Y in french usw.

 

Had anyone something better, it's interessing to read.

 

A pretty day to all !

 

Chti poupon

Version OSCOM CE Phoenix v1.0.5.9 + french language (v1.0.5.8 & Merge pull request #955 from gburton/1.0.5.9

php 7.1.3 MySQL 5.7.17  local with easyphp 

adds on: shipping spu 

common browser: Chrome

Shop multishop 2.2 with many addons.

Link to comment
Share on other sites

  • 4 weeks later...

Hi All

 

There is a fantastic addition to this add on by dmordred in the contributions page.

 

It puts a link on the main product - to the free product and it works great.

 

 

However, it would be nice to be able to display a message in the free product description page that links to the main product?

 

At the moment, I can't see how to do this.

 

Any suggestions?

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

Hi !

I don't see too ! Why give that customer buy directly !

I have worked another way.

So, why can we not prepare this promotions ?

There is no begining date.

But admin/banner.php has ! This give that:

 

Calendar for shedule & expiration dates for get_1_free

 

Modified files to obtain:

admin/get_1_free.php

     case 'insert':
       $products_id = tep_db_prepare_input($_POST['products_id']);
       $products_free_id = tep_db_prepare_input($_POST['products_free_id']);  
       $products_free_quantity = tep_db_prepare_input($_POST['products_free_quantity']);
       $products_qualify_quantity = tep_db_prepare_input($_POST['products_qualify_quantity']);
       $products_multiple = tep_db_prepare_input($_POST['products_multiple']);
       $get_1_free_sheduled_date = tep_db_prepare_input($_POST['get_1_free_sheduled_date']);
       $get_1_free_expires_date = tep_db_prepare_input($_POST['get_1_free_expires_date']);

       tep_db_query("insert into " . TABLE_GET_1_FREE . "
                                 (products_id,
                                  products_free_id,
                                  products_free_quantity,
                                  products_qualify_quantity,
                                  products_multiple,
                                  get_1_free_date_added,
                                  get_1_free_sheduled_date,
                                  get_1_free_expires_date,
                                  status)
                     values ('" . (int)$products_id . "',
                             '" . tep_db_input($products_free_id) . "',
                             '" . tep_db_input($products_free_quantity) . "',
                             '" . tep_db_input($products_qualify_quantity) . "',
                             '" . tep_db_input($products_multiple) . "',
                             now(),
                             '" . tep_db_input($get_1_free_sheduled_date) . "',
                             '" . tep_db_input($get_1_free_expires_date) . "',
                             '1')"
                   );

      case 'update':
       $get_1_free_id = tep_db_prepare_input($_POST['get_1_free_id']);
       $products_id = tep_db_prepare_input($_POST['products_id']);
       $products_free_id = tep_db_prepare_input($_POST['products_free_id']);
       $products_free_quantity = tep_db_prepare_input($_POST['products_free_quantity']);
       $products_qualify_quantity = tep_db_prepare_input($_POST['products_qualify_quantity']);
       $products_multiple = tep_db_prepare_input($_POST['products_multiple']);
       $get_1_free_sheduled_date = tep_db_prepare_input($_POST['get_1_free_sheduled_date']);
       $get_1_free_expires_date = tep_db_prepare_input($_POST['get_1_free_expires_date']);

       tep_db_query("update " . TABLE_GET_1_FREE . "
                     set products_free_id = '" . tep_db_input($products_free_id) . "',
                         products_free_quantity = '" . tep_db_input($products_free_quantity) . "',
                         products_free_quantity = '" . tep_db_input($products_free_quantity) . "',
                         products_qualify_quantity = '" . tep_db_input($products_qualify_quantity) . "',
                         products_multiple = '" . tep_db_input($products_multiple) . "',
                         get_1_free_last_modified = now(),
                         get_1_free_sheduled_date = '" . $get_1_free_sheduled_date . "',
                         get_1_free_expires_date = '" . $get_1_free_expires_date . "'
                     where get_1_free_id = '" . (int)$get_1_free_id . "'"
                     );

<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
<script language="javascript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
<script language="javascript"><!--
 var dateSheduled = new ctlSpiffyCalendarBox("dateSheduled", "new_get_1_free", "get_1_free_sheduled_date","btnDate","<?php echo $fInfo->get_1_free_sheduled_date; ?>",scBTNMODE_CUSTOMBLUE);
 var dateExpires = new ctlSpiffyCalendarBox("dateExpires", "new_get_1_free", "get_1_free_expires_date","btnDate","<?php echo $fInfo->get_1_free_expires_date; ?>",scBTNMODE_CUSTOMBLUE);
//-->
</script>
<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->

      $form_action = 'update';

     $product_qualify_query = tep_db_query("select p.products_id,
                                                   pd.products_name,
                                                   g1f.products_free_id,
                                                   g1f.products_free_quantity,
                                                   g1f.products_qualify_quantity,
                                                   g1f.products_multiple,
                                                   g1f.status,
                                                   g1f.get_1_free_sheduled_date,
                                                   g1f.get_1_free_expires_date
                                           from " . TABLE_PRODUCTS . " p,
                                                " . TABLE_PRODUCTS_DESCRIPTION . " pd,
                                                " . TABLE_GET_1_FREE . " g1f
                                           where p.products_id = pd.products_id
                                             and pd.language_id = '" . (int)$languages_id . "'
                                             and p.products_id = g1f.products_id
                                             and g1f.get_1_free_id = '" . (int)$_GET['fID'] . "'"
                                          );

            <td class="main"><?php echo tep_draw_input_field('products_free_quantity', (isset($fInfo->products_free_quantity) ? $fInfo->products_free_quantity : '')); ?></td>
         <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo TEXT_INFO_SHEDULED_DATE; ?><br><small>(dd/mm/yyyy)</small></td>
           <td valign="top" class="main"><script language="javascript">dateSheduled.writeControl(); dateSheduled.dateFormat="yyyy-MM-dd";</script></td>
         </tr>
         <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
         </tr>
         <tr>
           <td valign="top" class="main"><?php echo TEXT_INFO_EXPIRES_DATE; ?><br><small>(dd/mm/yyyy)</small></td>
           <td class="main"><script language="javascript">dateExpires.writeControl(); dateExpires.dateFormat="yyyy-MM-dd";</script></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><br><?php echo TEXT_GET_1_FREE_PRICE_TIP; ?></td>
           <td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '   <a href="' . tep_href_link(FILENAME_GET_1_FREE, 'page=' . $_GET['page'] . (isset($_GET['fID']) ? '&fID=' . $_GET['fID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
         </tr>
       </table></td>
     </form></tr>

TABLE_HEADING_ACTION; ?> </td>
             </tr>
<?php
   $get_1_free_query_raw = "select p.products_id,
                                   pd.products_name,
                                   p.products_price,
                                   g1f.get_1_free_id,
                                   g1f.products_free_id,
                                   g1f.products_free_quantity,
                                   g1f.products_qualify_quantity,
                                   g1f.products_multiple,
                                   g1f.get_1_free_date_added,
                                   g1f.get_1_free_last_modified,
                                   g1f.get_1_free_sheduled_date,
                                   g1f.get_1_free_expires_date,
                                   g1f.date_status_change,
                                   g1f.status
                            from " . TABLE_PRODUCTS . " p,
                                 " . TABLE_GET_1_FREE . " g1f,
                                 " . TABLE_PRODUCTS_DESCRIPTION . " pd
                            where p.products_id = pd.products_id
                              and pd.language_id = '" . (int)$languages_id . "'
                              and p.products_id = g1f.products_id
                            order by pd.products_name";
   $get_1_free_split = new splitPageResults($_GET['page'], 

fInfo->products_multiple);
       $contents[] = array('text' => '<br>' . TEXT_INFO_PRODUCTS_FREE . ' ' . $product_free['products_name']);
       $contents[] = array('text' => '' . TEXT_INFO_PRODUCTS_FREE_QUANTITY . ' ' . $fInfo->products_free_quantity);
       $contents[] = array('text' => '<br>' . TEXT_INFO_SHEDULED_DATE . ' <b>' . tep_date_short($fInfo->get_1_free_sheduled_date) . '</b>');
       $contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . tep_date_short($fInfo->get_1_free_expires_date) . '</b>');
       $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . tep_date_short($fInfo->date_status_change));
     }
     break;
 }
 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {

 

admin/includes/languages/<your language>/get_1_free.php

define('TEXT_INFO_SHEDULED_DATE', 'Begins At:');
define('TEXT_INFO_EXPIRES_DATE', 'Expires At:');

catalog/product_info.php

// start Get 1 Free
   // Display promotional text if this product qualifies for free product(s)
   $get_1_free_query = tep_db_query("select pd.products_name,
                                            g1f.products_free_quantity,
                                            g1f.products_qualify_quantity,
                                            g1f.get_1_free_sheduled_date,
                                            g1f.get_1_free_expires_date
                                     from " . TABLE_GET_1_FREE . " g1f,
                                          " . TABLE_PRODUCTS_DESCRIPTION . " pd
                                     where g1f.products_id = '" . (int)$product_info['products_id'] . "'
                                       and pd.products_id = g1f. products_free_id
                                       and g1f.get_1_free_sheduled_date < now()
                                       and (g1f.get_1_free_expires_date > now()
                                       or  g1f.get_1_free_expires_date = 0 )
                                       and pd.language_id = '" . (int)$languages_id . "'
                                       and status = '1'"
                                   );

   if (tep_db_num_rows($get_1_free_query) > 0) {
     $free_product = tep_db_fetch_array($get_1_free_query);
       $exp=explode('-',substr($free_product['get_1_free_expires_date'], 0, strpos($free_product['get_1_free_expires_date'], ' ')));
       $jour=$exp['2'];
       $mois=$exp['1'];
       $an=$exp['0'];
     echo '<p>' . sprintf (TEXT_GET_1_FREE_PROMOTION, $free_product['products_qualify_quantity'], $product_info['products_name'], $free_product['products_free_quantity'], $free_product['products_name'],$jour,$mois,$an) . '</p>';
   }
// end Get 1 Free?>
         <?php echo stripslashes($product_info['products_description']); ?>

catalog/includes/modules/product_listing.php

if(tep_db_num_rows(tep_db_query("select products_id, get_1_free_sheduled_date, get_1_free_expires_date, status from " . TABLE_GET_1_FREE . " where products_id = '" . (int)$listing['products_id'] . "' and get_1_free_sheduled_date < now() and (get_1_free_expires_date > now() or get_1_free_expires_date = 0 ) and status = '1'")))
{
 $lc_text .= '<span style="color:#ee5500; font-weight:bold;">'.TEXT_GET_1_FREE_PUB.'</span>';
}
           break;
         case 'PRODUCT_LIST_MANUFACTURER':

 

catalog/includes/application_top.php

// auto activate and expire banners
 require(DIR_WS_FUNCTIONS . 'banner.php');
 tep_activate_banners();
 tep_expire_banners();

// auto expire special products
 require(DIR_WS_FUNCTIONS . 'specials.php');
 tep_expire_specials();

// auto activeta & expire get_1_free products
 require(DIR_WS_FUNCTIONS . 'get_1_free.php');
 tep_activate_get_1_free();
 tep_expire_get_1_free();

// calculate category path
 if (isset($_GET['cPath'])) {

 

and finally:

catalog/includes/functions/get_1_free.php

  }
// Auto activate get_1_free
 function tep_activate_get_1_free() {
   $get_1_free_query = tep_db_query("select get_1_free_id, get_1_free_sheduled_date from " . TABLE_GET_1_FREE . " where get_1_free_sheduled_date != ''");
   if (tep_db_num_rows($get_1_free_query)) {
     while ($get_1_free = tep_db_fetch_array($get_1_free_query)) {
       if (date('Y-m-d H:i:s') >= $get_1_free['get_1_free_sheduled_date']) {
         tep_set_get_1_free_status($get_1_free['get_1_free_id'], '1');
       }
     }
   }
 }

////
?>

 

This works, etablish automatically pubs & wipes when obsoletes.

 

Enjoy !

 

bebe cash 59

Edited by bebe cash 59

Version OSCOM CE Phoenix v1.0.5.9 + french language (v1.0.5.8 & Merge pull request #955 from gburton/1.0.5.9

php 7.1.3 MySQL 5.7.17  local with easyphp 

adds on: shipping spu 

common browser: Chrome

Shop multishop 2.2 with many addons.

Link to comment
Share on other sites

Hi !

Another problem:

When we edit a product in admin get_1_free, the offer becomes the first in alphabetical order !!! Whet a garbage if we sleep a little !

Here are modifications to preselect the previous choice into the drop list:

modify the files to obtain:

 

catalog/admin/includes/functions/general.php

 function tep_draw_products_pull_down($name, $parameters = '', $exclude = '',$selected_id='') {
   global $currencies, $languages_id;

   if ($exclude == '') {
     $exclude = array();
   }

   $select_string = '<select name="' . $name . '"';

   if ($parameters) {
     $select_string .= ' ' . $parameters;
   }

   $select_string .= '>';

   $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name");
   while ($products = tep_db_fetch_array($products_query)) {
     if (!in_array($products['products_id'], $exclude)) {
       $select_string .= '<option value="' . $products['products_id'].'"'. ($selected_id==$products['products_id'] ? 'selected="selected"':'').'>' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>';
     }
   }

   $select_string .= '</select>';

   return $select_string;
 }

 

and

catalog/admin/get_1_free.php

            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo TEXT_GET_1_FREE_PRODUCTS_FREE; ?> </td>
           <td class="main"><?php echo tep_draw_products_pull_down('products_free_id','style="font-size:10px"','',(isset($fInfo->products_free_id) ? $fInfo->products_free_id : '')); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo TEXT_GET_1_FREE_PRODUCTS_FREE_QUANTITY; ?> </td>

 

That's all Folks

 

bebe cash 59

Version OSCOM CE Phoenix v1.0.5.9 + french language (v1.0.5.8 & Merge pull request #955 from gburton/1.0.5.9

php 7.1.3 MySQL 5.7.17  local with easyphp 

adds on: shipping spu 

common browser: Chrome

Shop multishop 2.2 with many addons.

Link to comment
Share on other sites

Sorry !

in post #299, i have forgotten a modification into catalog/admin/get_1_free.php:

 

?>
     <tr><form name="new_get_1_free" <?php echo 'action="' . tep_href_link(FILENAME_GET_1_FREE, tep_get_all_get_params(array('action', 'info', 'fID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="POST" ,enctype="multipart/form-data">
<?php 
     if ($form_action == 'update') echo tep_draw_hidden_field('get_1_free_id', $_GET['fID']); 
?>

 

editing is now forbidden --> new post !

Good night !

Version OSCOM CE Phoenix v1.0.5.9 + french language (v1.0.5.8 & Merge pull request #955 from gburton/1.0.5.9

php 7.1.3 MySQL 5.7.17  local with easyphp 

adds on: shipping spu 

common browser: Chrome

Shop multishop 2.2 with many addons.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...