SuperSewist Posted August 12, 2008 Posted August 12, 2008 before I go reinventing the wheel, is there a contrib out there that will allow an input field for PRICE, that the customer can fill in. Yes really, any price is fine except zero. I want to do a "name your price" promotion. It's also a bit of a social experiment. TIA. Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad) Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO
SuperSewist Posted August 15, 2008 Author Posted August 15, 2008 bump? any ideas how to pull this off? has anyone attempted this before? Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad) Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO
MrPhil Posted August 15, 2008 Posted August 15, 2008 Have you looked at the various "auction" contributions? One of them may do what you want, if you find one that ends the auction as soon as there's a non-zero bid. It might not be too hard to modify an auction contribution to end immediately, rather than waiting for other entries, but I haven't looked into it.
SuperSewist Posted August 16, 2008 Author Posted August 16, 2008 thanks MrPhil :) great start and jigged my brain to understand what needs to be done to make it work. :thumbsup: read over auctions 2.1 by psylencer. downside is I would have to continually put up a replacement auction when an item is sold (or automate it). so for that coding, 'MayAsWell' just stick to what I want and code in an input field for price with all the extras that goes with it. So, now I know what I will be doing this week-end! PS and shameless sales plug: hope to have NameYourPrice (wonder if I could call it PriceIsRight? ! :lol: ! ) installed and working by september 1 to celebrate "national sewing month" so if you've been wanting to teach your kids to sew on your own budget and time, check it out. Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad) Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO
SuperSewist Posted August 16, 2008 Author Posted August 16, 2008 decided to work with an adaptation to the existing "specials" section. so far got the admin side to (almost) work. in admin/specials.php - I've included one line before and after that I did not change. this "works" - displays NYP or $price according to checkbox written to db. <td class="dataTableContent"><?php echo $specials['products_name']; ?></td> <!-- BOF Separate Pricing Per Customer and NameYourPrice --> <?php if ($specials['specials_nyp'] == '1') { echo '<td class="dataTableContent" align="right"><span class="oldPrice">' . $currencies->format($specials['products_price']) . '</span> <span class="specialPrice"> NYP (' . $all_groups[$specials['customers_group_id']] . ')</span></td>' . "/n"; } else { echo '<td class="dataTableContent" align="right"><span class="oldPrice">' . $currencies->format($specials['products_price']) . '</span> <span class="specialPrice">' . $currencies->format($specials['specials_new_products_price']) . ' (' . $all_groups[$specials['customers_group_id']] . ')</span></td>' . "/n"; } ?> <!-- EOF Separate Pricing per Customer --> <td class="dataTableContent" align="right"> this "doesn't" - always displays "NO" even when db is set to '1' $contents[] = array('text' => '<br>' . TEXT_INFO_ORIGINAL_PRICE . ' ' . $currencies->format($sInfo->products_price)); if ($specials['specials_nyp'] == '1') { $contents[] = array('text' => '' . TEXT_INFO_IS_NYP . ' YES ' ); } else { $contents[] = array('text' => '' . TEXT_INFO_IS_NYP . ' NO ' ); } $contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . ' ' . $currencies->format($sInfo->specials_new_products_price)); but the IF stmt is the same except one's embedded php-in-html and one's not. Could that really make a dif ??? If so , how to fix? I'm stumped. For now, I think I can move on to the catalog side and wait for inspiration and/or advice on this question. lots of readers on this thread, please do put your 2-cents in. Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad) Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO
MrPhil Posted August 17, 2008 Posted August 17, 2008 OK, I see three elements (each a single element array) being added to the $contents array. [0] and [2] should always be the same, but the problem is (you say) that the second (element [1]) is always getting the "NO" value. The first thing I'd do is to echo out the value of $specials['specials_nyp'] just to confirm that you're arriving at that point with the expected value. Since you didn't show the rest of the code, it's possible that there's something preventing that variable from getting through. Is this code within a function, and you forgot to either pass in $specials or declare it global? Since you see the "NO" value, I assume you're referencing the correct element of $contents.
SuperSewist Posted August 18, 2008 Author Posted August 18, 2008 Thanks MrPhil for once again pointing me in the right direction. This is why I ain't that great a coder even though, erroneous though it may be, I fancy myself rather clever at the logistics of program flow. Just don't know how to make it happen without a lot of T&E and begging for bones. Knowing what I'm looking for is a BIG HELP! so here's what your clue showed me: changed the second instance from: if ($specials['specials_nyp'] == '1') { to: if ($sInfo->specials_nyp == '1') { "et voila" much joy. There was a new query between the two that changed the variable name along the way that I had missed. I think. Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad) Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO
SuperSewist Posted August 18, 2008 Author Posted August 18, 2008 New Question. going through the catalog side and I have SPPC installed, which uses a new class "PriceFormatter". How much trouble am I in for by trying to put the string "?NYP?" into a price field (numeric?) (or even the string "") instead of the price from the product database (or the specials database) and is therefor used in all kinds of calculations throughout several of the php files (like attributes add-on pricing or taxes). At least, I think that's so, until the customer's input price gets inserted into their cart, at which point it is a number again and should not be an issue for the rest of the checkout process. or is php clever enough to keep the string, and use it as zero in calculations as opposed to giving an error. The idea is to give the customer an input box that has a default value "?NYP?" (preferred) or is blank (less desirable but OK). The basic plan is to find places (OhMy!) where oscommerce queries the dB for a price, and surround that with 'except if this product is a specials-NameYourPrice, display ?NYP? instead". As Always, TIA. Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad) Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO
SuperSewist Posted August 20, 2008 Author Posted August 20, 2008 I am TERRIBLE at javascript. Would someone ?PLEASE? code this for me: ----- Upon exiting the field "cart_nyp_price", check to see if the amount entered is greater than zero. If so, display message "WOW! Great Price!" [leaving customer to click "add to cart" at their leisure] If 0, and $product_id starts with a "7", display message "If you would like this product for free, see our BONUS GIFTS section (http://link)" If 0, and $product_id starts with a "1", display message "Is this item really worth nothing to you?" If anything else, display message "Please enter numbers with one decimal point only" ----- Oh, thank you EVER so much in advance! This will go in catalog/product_info.php as part of the tep_draw_input_field to get the customer's desired price, at the place where the price pulled from the products dB would normally be displayed. and right beside the point where the input field for cart_quantity. I thought it would be better handled by javascript than through clicking the "add to cart" button and letting php handle it and re-post the page, but open to suggestions. Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad) Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO
RodrigoDC Posted August 20, 2008 Posted August 20, 2008 Hi, please keep me posted if you manage to turn this great idea into a contrib. I have been looking for this functionality for a while. Thanks and best of luck. RodrigoDC
SuperSewist Posted August 21, 2008 Author Posted August 21, 2008 Thanks I'm looking forward to using it as well. I do intend on offering my modded package and install notes to anyone who asks as I have done in the past, although I probably won't put it up as a contrib 'cause I don't know enough to keep it moderated. Anyone able to help with the requested javascript? Pretty Please? With sugar on top?? Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad) Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO
Guest Posted October 8, 2008 Posted October 8, 2008 before I go reinventing the wheel, is there a contrib out there that will allow an input field for PRICE, that the customer can fill in. Yes really, any price is fine except zero. I want to do a "name your price" promotion. It's also a bit of a social experiment. TIA. Sounds pretty straight forward to me. Ill make it for you. I'll let you know when Im finished - shouldn't take much more than a day or two. PHP is the ONLY way to do this. Javascript just aint compatible enough. Start listing features people. I'll do all that I can. By the way, I just did something similar with HCL Live admin. I converted it into a "Live Offer" script whereby you can offer people a cheaper price on an item which expires in a given amount of time. A Javacript Div Table is flashed infront of them while they are viewing an item. THey can choose to accept, decline or Get Help. So far, no-one has accepted any offers I've sent. Seems to be a waste of time. I've got a feeling this won't work much better, however the concept sounds cool and may give us some valuable insight into the minds of our shoppers. Dan Herlihy AKA PSy.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.