Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribuion] Discount Groups - feedback


LazyCat

Recommended Posts

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

i'm working on it and i'm also checking how it work under the MS1, so it may take a little ...

 

I just updated to the latest snapshot(todays - hope it is stable) so don't need to check it on MS1 on my account :)

Link to comment
Share on other sites

Looks Great !!!!!!! and is workin good.

 

I only seem to have 1 problem and that is in the admin section.

 

When I go in to customers_groups.php to delete a category that had been given a discount and click on the delete button the page is refreashed but the info is not removed from the GROUPS_TO_CATEGORIES table.

 

I can go in with phpadmin and remove it with no problems.

 

Also is there a way to not add the discount to a product if it is listed as a special.

 

And

 

Is there a way to show the discounted prices in the manner that specials is shown.

 

Thanks

Link to comment
Share on other sites

i've found were my problem is...

 

i've instaled ABW Price Breaks Per Quantity contribution - without this mod lines in some files your contribution is lookinf like fool working.

 

is it possible to combine your mod with ABW mod...

Link to comment
Share on other sites

i've found were my problem is...

 

i've instaled ABW Price Breaks Per Quantity contribution - without this mod lines in some files your contribution is lookinf like fool working.

 

is it possible to combine your mod with ABW mod...

 

i really don't know :( it's up to you to try, but thinking in how my contribution works should be possible...

 

btw i'm working at the bugfix, sorry for the delay, but Murphy's law striked again this morning...

Link to comment
Share on other sites

LazyCat,

Will this mod do a overall discount based on total quantity bought per vendor (counting all customers)?

What I need is when overall 100 items are sold from a specific vendor, the price drops.

Link to comment
Share on other sites

I only seem to have 1 problem and that is in the admin section.

 

When I go in to customers_groups.php to delete a category that had been given a discount and click on the delete button the page is refreashed but the info is not removed from the GROUPS_TO_CATEGORIES table.

 

Does somebody know a solution for this bug? I don?t, and I need help.

 

Rainer

Link to comment
Share on other sites

Aha, i will check it later.

 

Other problem with product_info file and MS1:

 

Your install.txt:

 

replace

 

 <td align="center" class="main"><input type="hidden" name="products_id" value="<?php echo $product_info_values['products_id']; ?>"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

with

 

 <td align="center" class="main"><input type="hidden" name="category_id" value=<?php echo '"' . tep_get_category_id($cPath) . '"' ?>><input type="hidden" name="products_id" value="<?php echo $product_info_values['products_id']; ?>"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

My product_info looks like this, at this section:

 

<td align="right" class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

Case I?m not a php-profi, I don?t know how to do it right.

Link to comment
Share on other sites

the trick is to change $product _info_values into $product_info wherever you find it in the notes for the installation.... i'm worinking on a fully MS1 compliant version of the contribution, but changing that should work

Link to comment
Share on other sites

  • 5 weeks later...

i tried to modify catalog/includes/modules/new_products.php for ms1.

anyone like to check?

 

<?php

/*

 $Id: new_products.php,v 1.33 2003/02/12 23:55:58 hpdl Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2003 osCommerce



 Released under the GNU General Public License

*/

?>

<!-- new_products //-->

<?php

 $info_box_contents = array();

 $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));



 new contentBoxHeading($info_box_contents);



 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

   $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 } else {

   $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 }



 $row = 0;

 $col = 0;

 $info_box_contents = array();

 while ($new_products = tep_db_fetch_array($new_products_query)) {

   $new_products['products_name'] = tep_get_products_name($new_products['products_id']);



$category = tep_get_best_category_discount($new_products["products_id"]); 

$price = $new_products['products_price']; 

if ($category >= 0 ) { 

$discount = tep_get_discount($category); 

if ($discount > 0) $price = $price - ($price/100)*$discount; 

} 



if (tep_not_null($new_products['specials_new_products_price'])) { 

$whats_new_price = '<s>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</s><br>'; 

$whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($price, tep_get_tax_rate($new_products['products_tax_class_id'])) . '</span>'; 

} else { 

$whats_new_price = $currencies->display_price($price, tep_get_tax_rate($new_products['products_tax_class_id'])); 

} 



   $info_box_contents[$row][$col] = array('align' => 'center',

                                          'params' => 'class="smallText" width="33%" valign="top"',

                                         #original code 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));



'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $category . 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $whats_new_price); 

                                        

   $col ++;

   if ($col > 2) {

     $col = 0;

     $row ++;

   }

 }



 new contentBox($info_box_contents);

?>

<!-- new_products_eof //-->

Link to comment
Share on other sites

bugfix.. change

 

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $category . 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $whats_new_price);

 

to

 

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $category . '&products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $whats_new_price);

 

only a & in front of products_id... ;-)

Link to comment
Share on other sites

looks good.

 

is there an updated version for ms2.

 

one other suggestion- it sounds like this contrib will not show the discounts- i want it to- and have a slash through the old price. Perhaps you can make a preference...

Link to comment
Share on other sites

I made changes according to the intruction and was closed to finish until I was stuck with this problem. The file,/includes/modules/default_specials.php, doesn't exist.

 

Thank you for your reply in advance.

Link to comment
Share on other sites

  • 2 weeks later...

Analog ralph's modificaton of new_products.php here's a new version of catalog/products_new.php

 

replace

if ($new_price = tep_get_products_special_price($products_new['products_id'])) {

       $products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>';

     } else {

       $products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));

     }

 

with

$category = tep_get_best_category_discount($products_new["products_id"]); 

	 $price = $products_new['products_price']; 

	 if ($category >= 0 ) { 

   $discount = tep_get_discount($category); 

   if ($discount > 0) $price = $price - ($price/100)*$discount; 

	 } 



	 if (tep_not_null($products_new['specials_new_products_price'])) { 

   $whats_new_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s><br>'; 

   $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>'; 

	 } else { 

   $whats_new_price = $currencies->display_price($price, tep_get_tax_rate($products_new['products_tax_class_id'])); 

	 }

 

and replace

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>

 

with

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $whats_new_price; ?></td>

Link to comment
Share on other sites

The same modification in catalog/includes/boxes/whats_new.php:

 

replace

if (tep_not_null($random_product['specials_new_products_price'])) {

     $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';

     $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';

   } else {

     $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));

   }

 

with

$category = tep_get_best_category_discount($random_product["products_id"]); 

 $price = $random_product['products_price']; 

 if ($category >= 0 ) { 

	 $discount = tep_get_discount($category); 

	 if ($discount > 0) $price = $price - ($price/100)*$discount; 

 } 



 if (tep_not_null($random_product['specials_new_products_price'])) { 

	 $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s><br>'; 

	 $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($price, tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; 

 } else { 

	 $whats_new_price = $currencies->display_price($price, tep_get_tax_rate($random_product['products_tax_class_id'])); 

 }

Link to comment
Share on other sites

  • 4 weeks later...

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...