Jump to content

Sigma Matt

Members
  • Content count

    18
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Matthew Edson
  • Gender
    Male
  1. I've been doing a lot of browsing online and haven't found much help with this. My website is a print-oriented one, and I'm trying to develop an easy way for the customer to upload their images, which would be various different formats to the site, specifically to an individual item on the page, and when we receive the file, we get the art as well. I might be over-explaining it, but does anyone know of a feature that will work on my site?
  2. Sigma Matt

    Quantity Price Break - Tweaking

    Not to sound rude, but what exactly would I need to say to get it to not show that first block of information? I am relatively new to this and am not sure which item(s) would need to be removed or not to get this to work.
  3. Sigma Matt

    Quantity Price Break - Tweaking

    what would I need to put for "do stuff" to tell it to specifically not show that first block of information?
  4. Sigma Matt

    Quantity Price Break - Tweaking

    the reason it was acting up for the quantities was something I could fix from the admin area, the big thing I gotta figure out is how to not make it go 1+,100+, etc., but just make it start at 100+.
  5. Sigma Matt

    Quantity Price Break - Tweaking

    <?php /* $Id: PriceFormatter.php admin version,v 1.7 2006/12/23 JanZ Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ /* PriceFormatter.php - module to support quantity pricing Created 2003, Beezle Software based on some code mods by WasaLab Oy (Thanks!) Refactored 2008, Moved pricebreak data into dedicated table */ class PriceFormatter { function PriceFormatter() { $this->thePrice = -1; $this->taxClass = -1; $this->qtyBlocks = 1; $this->price_breaks = array(); $this->hasQuantityPrice = false; $this->hiPrice = -1; $this->lowPrice = -1; $this->hasSpecialPrice = false; //tep_not_null($this->specialPrice); $this->specialPrice = NULL; //$prices['specials_new_products_price']; } function loadProduct($product_id, $products_price, $products_tax_class_id, $qtyBlocks, $price_breaks_array = NULL) { //Collect required data //Price-breaks if (!tep_not_null($price_breaks_array)) { $price_breaks_array = array(); $price_breaks_query = tep_db_query("select products_price, products_qty from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id = '" . tep_db_input($product_id) . "' order by products_qty"); while ($price_break = tep_db_fetch_array($price_breaks_query)) { $price_breaks_array[] = $price_break; } } //Specials $products_special_price = NULL; $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . tep_db_input($product_id) . "'"); if($special = tep_db_fetch_array($specials_query)) { $products_special_price = $special['specials_new_products_price']; } //Compose cachable structure $price_formatter_data = array( 'products_price' => $products_price, 'products_special_price' => $products_special_price, 'products_tax_class_id' => $products_tax_class_id, 'price_breaks' => $price_breaks_array, 'qtyBlocks' => $qtyBlocks); //Assign members $this->thePrice = $price_formatter_data['products_price']; $this->taxClass = $price_formatter_data['products_tax_class_id']; $this->qtyBlocks = $price_formatter_data['qtyBlocks']; $this->price_breaks = $price_formatter_data['price_breaks']; $this->specialPrice = $price_formatter_data['products_special_price']; $this->hasSpecialPrice = tep_not_null($this->specialPrice); //Custom $this->hasQuantityPrice = false; $this->hiPrice = $this->thePrice; $this->lowPrice = $this->thePrice; if (count($this->price_breaks) > 0) { $this->hasQuantityPrice = true; foreach($this->price_breaks as $price_break) { $this->hiPrice = max($this->hiPrice, $price_break['products_price']); $this->lowPrice = min($this->lowPrice, $price_break['products_price']); } } /* Change support special prices If any price level has a price greater than the special price lower it to the special price */ if (true == $this->hasSpecialPrice) { foreach($this->price_breaks as $price_break) { $price_break['products_price'] = min($price_break['products_price'], $this->specialPrice); } } //end changes to support special prices } function computePrice($qty, $nof_other_items_in_cart_same_cat = 0) { $qty = $this->adjustQty($qty); // Add the number of other items in the cart from the same category to see if a price break is reached $qty += $nof_other_items_in_cart_same_cat; // Compute base price, taking into account the possibility of a special $price = (true == $this->hasSpecialPrice) ? $this->specialPrice : $this->thePrice; foreach($this->price_breaks as $price_break) { if($qty >= $price_break['products_qty']) { $price = $price_break['products_price']; } } return $price; } function adjustQty($qty, $qtyBlocks = NULL) { // Force QTY_BLOCKS granularity if(!tep_not_null($qtyBlocks)) { $qtyBlocks = $this->getQtyBlocks(); } if ($qty < 1) $qty = 1; if ($qtyBlocks >= 1) { if ($qty < $qtyBlocks) $qty = $qtyBlocks; if (($qty % $qtyBlocks) != 0) $qty += ($qtyBlocks - ($qty % $qtyBlocks)); } return $qty; } function getQtyBlocks() { return $this->qtyBlocks; } function getPrice() { return $this->thePrice; } function getLowPrice() { return $this->lowPrice; } function getHiPrice() { return $this->hiPrice; } function hasSpecialPrice() { return $this->hasSpecialPrice; } function hasQuantityPrice() { return $this->hasQuantityPrice; } function getDiscountSaving($original_price, $discount_price) { $difference = $original_price - $discount_price; return round (($difference / $original_price) * 100) . '%'; } function getPriceString($style='productPriceInBox') { global $currencies; // If you want to change the format of the price/quantity table // displayed on the product information page, here is where you do it. if(true == $this->hasQuantityPrice) { $lc_text = '<table border="0" cellspacing="0" cellpadding="0" class="infoBox" align="right"> <tr valign="top"> <td> <table border="0" cellspacing="1" cellpadding="4" class="infobox">'; $lc_text .= '<tr valign="top"><td width="120" class="infoBoxHeading">' . TEXT_ENTER_QUANTITY .'</td><td align="center" class="infoBoxHeading">1+' . '</td>'; foreach($this->price_breaks as $price_break) { $lc_text .= '<td align="center" width="50" class="infoBoxHeading">' . $price_break['products_qty'] .'+ </td>'; } $lc_text .= '<tr valign="top"><td width="120" class="infoBoxContents">' . TEXT_PRICE_PER_PIECE . '</td><td align="center" width="50" class="infoBoxContents">'; if (true == $this->hasSpecialPrice) { $lc_text .= '<s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> ' .'</td>'; } else { $lc_text .= '' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</td>'; } foreach($this->price_breaks as $price_break) { $lc_text .= '<td align="center" width="50" class="infoBoxContents">' . $currencies->display_price($price_break['products_price'], tep_get_tax_rate($this->taxClass)) .'</td>'; } $lc_text .= '</tr>'; // Begin saving calculation $lc_text .= '<tr valign="top"><td width="120" class="infoBoxContents">' . TEXT_SAVINGS . '</td>'; if (true == $this->hasSpecialPrice) { $lc_text .= '<td align="center" class="infoBoxContents">' . $this->getDiscountSaving($this->thePrice, $this->specialPrice) .'</td>'; } else { $lc_text .= '<td align="center" class="infoBoxContents">- </td>'; } foreach($this->price_breaks as $price_break) { $lc_text .= '<td align="center" width="50" class="infoBoxContents">' . $this->getDiscountSaving($this->thePrice, $price_break['products_price']) .'</td>'; } $lc_text .= '</tr></table></td></tr></table>'; } else { if (true == $this->hasSpecialPrice) { $lc_text = ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> '; } else { $lc_text = ' ' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . ' '; } } return $lc_text; } function getPriceStringShort() { global $currencies; if(true == $this->hasQuantityPrice) { $lc_text = ' <big>' . TEXT_PRICE_BREAKS . ' ' . $currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass)) . ' </big><br><br><br>'; } else { if (true == $this->hasSpecialPrice) { $lc_text = ' <big><s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <br><span class="productSpecialPrice">' . TEXT_ON_SALE . ' ' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</big></span> <br><br><br>'; } else { $lc_text = ' <big>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . ' </big><br><br><br>'; } } return $lc_text; } /* Old (original formatting) function getPriceString($style='"productPriceInBox"') { global $currencies; if (true == $this->hasSpecialPrice) { $lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">'; $lc_text .= '<tr><td align="center" class=' . $style. ' colspan="2">'; $lc_text .= ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> ' .'</td></tr>'; } else { $lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">'; $lc_text .= '<tr><td align="center" class=' . $style. ' colspan="2">' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</td></tr>'; } // If you want to change the format of the price/quantity table // displayed on the product information page, here is where you do it. if(true == $this->hasQuantityPrice) { foreach($this->price_breaks as $price_break) { $lc_text .= '<tr><td class='.$style.'>' . $price_break['products_qty'] .'+ </td><td class='.$style.'>' . $currencies->display_price($price_break['products_price'], tep_get_tax_rate($this->taxClass)) .'</td></tr>'; } $lc_text .= '</table>'; } else { if (true == $this->hasSpecialPrice) { $lc_text = ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> '; } else { $lc_text = ' ' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . ' '; } } return $lc_text; } function getPriceStringShort() { global $currencies; if (true == $this->hasSpecialPrice) { $lc_text = ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> '; } else { if(true == $this->hasQuantityPrice) { $lc_text = ' ' . $currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass)) . ' - ' . $currencies->display_price($this->hiPrice, tep_get_tax_rate($this->taxClass)) . ' '; } else { $lc_text = ' ' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . ' '; } } return $lc_text; } */ } ?> I'm not entirely sure what it is I am looking at. Can you help?
  6. Sigma Matt

    Quantity Price Breaks

    I successfully installed the Quantity Price Break on my site, and a couple of interesting things happened that I want to fix. As a default, it's letting me leave pricing for 1 item+. I'd like to omit the price of the item at 1, and then just go to my table, how do I do this? Also, when I've been testing, it randomly changes the number of actual products in the shopping cart, for instance, I typed in 100, and it put 105. Why is it doing this and how can I fix it? Lastly, which might be the easiest question, ha, how do I change the positioning of this table from being at the top of the product listing? Thanks for all of your help, I am relatively new and any help would be most appreciated!
  7. I successfully installed the Quantity Price Break on my site, and a couple of interesting things happened that I want to fix. As a default, it's letting me leave pricing for 1 item+. I'd like to omit the price of the item at 1, and then just go to my table, how do I do this? Also, when I've been testing, it randomly changes the number of actual products in the shopping cart, for instance, I typed in 100, and it put 105. Why is it doing this and how can I fix it? Lastly, which might be the easiest question, ha, how do I change the positioning of this table from being at the top of the product listing? Thanks for all of your help, I am relatively new and any help would be most appreciated!
  8. Sigma Matt

    Quantity Price Break

    Well I figured out the quantity thing, but it did present another question. Why, and how do I stop it from, adding in extras? I typed in 200 and got 203, I typed in 100 and got 105. Also, how do I change where this thing falls on the page?
  9. Sigma Matt

    Quantity Price Break

    http://sigmacalendars.com/images/pricebreak_1.jpg Okay, I got it to work. Now I guess my next few questions will be how to tweak it? How do I make it so the 1+ option is gone and it JUST starts at 100+, etc? Then, I can only add 99 to the cart, when I will be needing to add large quantities as you can see.
  10. Sigma Matt

    Quantity Price Break

    This was the screen that I had gotten, and similar looking copy appears next to each product on the page. All I did was upload the changed and the new files from the add-on instructions. I didn't manually type everything in, as I wasn't worried about changing the site when I can change those things later. Was I supposed to manually change each one, and that's why it's not working properly for me?
  11. Sigma Matt

    Quantity Price Break

    Alright, I redid all of my stuff to get back to this. Sorry for the confusion. I didn't entirely understand the other issues so I figured if I started from scratch on a topic it might help me out better. <a href="http://s19.beta.photobucket.com/user/RedMaverickZero/media/sigma_error1_zpsb77ba650.jpg.html" target="_blank"><img src="http://i19.photobucket.com/albums/b175/RedMaverickZero/sigma_error1_zpsb77ba650.jpg" border="0" alt="Photobucket"/></a>
  12. Sigma Matt

    Quantity Price Break

    For sure! I've downloaded this, which seems to be the newest version of the Quantity Price Break add-on (http://addons.oscommerce.com/info/8040/v,23). I've followed the instructions on the site and installed the pages, and updated the ones neccessary, but it drastically altered my admin userface, and on top of that didn't work. My store hasn't been developed just yet because, like I said, I want all of my pieces to be completed before I do. I've reinstalled oscommerce 2.3.1 a few different times.
  13. Sigma Matt

    Quantity Price Break

    I'm relatively new to oscommerce and am developing a website. I've installed oscommerce 2.3.1 per what the add-on required, but I'm having a bit of trouble with getting the add-on to work right or at all. I'm building a simple site, so nothing has been done just yet, I am waiting on this part to be set in before I move forward. When I've gone through the installation web file, I had went through and just uploaded the "changed" files, since my site is new I didn't think this would be an issue. Is there a reason why just uploading the files this way wouldn't work?
×