stephaniezara Posted March 1, 2004 Posted March 1, 2004 Hello people, I want to install this contribution: Quantity Price Breaks Per Product http://www.oscommerce.com/community/contributions,1242 I feel fairly confident about editing the necessary php as I've done this before to install other contribs. What stumps me and is making me stare blankly at the screen drooling like an idiot is this: Use your favorite MySQL tool to add the following to the database: alter table products add column products_price1 decimal(15,4) not null default 0.0; alter table products add column products_price2 decimal(15,4) not null default 0.0; alter table products add column products_price3 decimal(15,4) not null default 0.0; alter table products add column products_price4 decimal(15,4) not null default 0.0; alter table products add column products_price1_qty int not null default 0; alter table products add column products_price2_qty int not null default 0; alter table products add column products_price3_qty int not null default 0; alter table products add column products_price4_qty int not null default 0; alter table products add column products_qty_blocks int not null default 1; ...huh? I have access to the database through php my admin but I have NO clue what to do there. Zero. I downloaded Mike Sullivan's instructions and it looks pretty straight forward after that. The priginal instructions mentioned something about patches and all but I'm not sure what to do with that. I'm pretty sure I have to latest version of OSC. Please I would be SO grateful if one of you smart people could help me out. I'm really lost here but I'm sure this is kiddie stuff for most of you. Thanks!!
Guest Posted March 1, 2004 Posted March 1, 2004 there should be a spot in phpmyadmin where it says sql, that is where you put that query into the system and then execute the sql query.
GraphicsGuy Posted March 2, 2004 Posted March 2, 2004 In phpMyAdmin: Click the database name at the top of the list of tables in the left pane. Then in the resulting main window, the second "tab" should be "SQL". In that tab there is a large memo box. Copy and paste: alter table products add column products_price1 decimal(15,4) not null default 0.0;alter table products add column products_price2 decimal(15,4) not null default 0.0; alter table products add column products_price3 decimal(15,4) not null default 0.0; alter table products add column products_price4 decimal(15,4) not null default 0.0; alter table products add column products_price1_qty int not null default 0; alter table products add column products_price2_qty int not null default 0; alter table products add column products_price3_qty int not null default 0; alter table products add column products_price4_qty int not null default 0; alter table products add column products_qty_blocks int not null default 1; into the box and click the "Go" button. This should take care of it. If there are any errors, it will tell you in a nearly plain english error message. Rule #1: Without exception, backup your database and files before making any changes to your files or database. Rule #2: Make sure there are no exceptions to Rule #1.
stephaniezara Posted March 2, 2004 Author Posted March 2, 2004 Okay...I added the bit to the database. Turned out to be much simpler than I thought it would be! Thanks! I edited all of the php files and... I killed it! This is what is says now when I try to access to store front: Parse error: parse error in /home/hamilton/public_html/catalog/includes/classes/shopping_cart.php on line 216 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/hamilton/public_html/catalog/includes/classes/shopping_cart.php:216) in /home/hamilton/public_html/catalog/includes/functions/sessions.php on line 67 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/hamilton/public_html/catalog/includes/classes/shopping_cart.php:216) in /home/hamilton/public_html/catalog/includes/functions/sessions.php on line 67 Fatal error: Cannot instantiate non-existent class: shoppingcart in /home/hamilton/public_html/catalog/includes/application_top.php on line 253 ...Joy! The only file I was not able to edit as instructed was catalog_includes_modules_product_listing where it could not find the text I was meant to add on to. namely, ========================== Find: case 'PRODUCT_LIST_PRICE': $lc_align = 'right'; Add after the above: $pf->parse($listing); $lc_text = $pf->getPriceStringShort(); I had another file called product_listing_orig which must have been the backup of the original file that I had to change for another contrib. The text I am meant to add on to WAS found in that file (that file however bore no resemblance to the product_listing.php page though as the product_listing.php that I was using had nothing that said case 'xxxxxxx'; and the original had it everywhere. Anyway...I tried editing the original and trying that but I get the same error. :blink: :huh: :(
stephaniezara Posted March 2, 2004 Author Posted March 2, 2004 I will also mention that the admin area still works and from there this contrib seems to be working fine.
GraphicsGuy Posted March 2, 2004 Posted March 2, 2004 The PRODUCT_LIST_PRICE issue does need to be resolved to make the mod work. It sounds like some other contrib has substantially modified that structure and it may take a PHP guru to bring them together. However, I don't think that problem is responsible for the error messages you are getting . It hasn't gotten that far yet. Perhaps if you post line 216 and about 10-15 lines each side of it from .../classes/shopping_cart.php then something might stand out. I'm not a PHP expert, but I have been looking at so much code as I build my store that I am getting fairly good at spotting some of the more common syntax errors. :) I think PHP would be a lot easier on the sanity if it wasn't for commas, semicolons and periods; but then again, probably not. :) Rule #1: Without exception, backup your database and files before making any changes to your files or database. Rule #2: Make sure there are no exceptions to Rule #1.
Guest Posted March 2, 2004 Posted March 2, 2004 perhaps we should tackle one problem at a time, you are receiving a session error, what is the last line of your configure.php file? do you have 'mysql' in there ? if not, add it for storing sessions. you could also have 'empty white space' at the end of the file you edited, go check at the last ?> and hit the delete key a few times.
stephaniezara Posted March 2, 2004 Author Posted March 2, 2004 Okay...I took includes/classes/shopping_cart.php, the file that was getting the errors, and used my backed up copy. I no longer got any errors and was able to access the shop but of course the contrib doesn't work that way. So I went in and made the changed to the code again and this time I get a slightly shorter error but still the same thing. I was going to post the code here but I had another look at the changes I was asked to make and I found a typo!! What should have said this: // products price if ($product = $pf->loadProduct($products_id)){ Said this instead: / products price if ($product = $pf->loadProduct($products_id)){ Alright so I fixed that. The price break contrib seems to work now. Only problem is...it seems to have undone some of the changes I made previously. If someone could please remind me which file I am to edit to get rid of the manufacturers box on the left column I would appreciate it. And/or remind me where I can find the Wiki documents. it's been months since I last had to do this stuff. Other big problem is...it seems to have killed a contrib I added to allow ordering from the product listings! Wahh! This was REALLY important! That was the first contrib I added (I've only added that, the checkout without membership one, and this volume discount one) and I remember that instead of asking me to make changes to files it gave me whole new files to replace mine. Obviously I dont want to do that because it would kill this new one. So......what I'm asking is...Is there a was for me to easily enable ordering from the product listing again? It's really important because this shop is for my client's wholesale customers to order from and I need to make it just as simple as it is for them to do it on paper and just entering in quantities down the column is perfect. ONE MORE THING...I need the product listing page to reflect the volume discounts in the price area. Not SUPER important as everything is just the same price (we're selling flats of plants) and I can make a notation somewhere else but it would be nice. Sorry for so many questions! I'm a VISUAL designer by nature and all of this code just makes my head spin!
stephaniezara Posted March 2, 2004 Author Posted March 2, 2004 I tried to find a place to edit my last post but I can't. Anyway I found Wiki and I got rid of the unwanted boxes. No clue how they reappeared since that's not even one of the pages I edited but oh well. Still stumped about how to re enable ordering from the products listing so any help there would be apreciated greatly! Thanks for your help! This forum has always come through when I needed it!
GraphicsGuy Posted March 2, 2004 Posted March 2, 2004 I'm not sure of exactly which contrib it is that you need to reapply, someone else might recognize it and identify it or you might be able to find it in the contrib listings. But regarding your mention of it only giving complete files replacements, you might try a program called WinMerge. I believe you can download it from SourceForge. It allows you to have your file in one pane and the altered one in another and it highlights the differences. You can then copy and paste the lines that are in the altered file into yours. Save it, and then reupload it. I actually like this method best because it is easier (to me) to see possible conflicts with other contribs. Rule #1: Without exception, backup your database and files before making any changes to your files or database. Rule #2: Make sure there are no exceptions to Rule #1.
CC Posted March 2, 2004 Posted March 2, 2004 Hi have you got the link to the contribution your using? I dont mind taking a look at the code and seeing what the problem might be, but I need to know the exact contribution first... Also, are you using MS2.2 ?? As the contribution sounds as though it was made for MS1 or older, but I could be wrong. Let me know the link and I'll look for you.
stephaniezara Posted March 3, 2004 Author Posted March 3, 2004 Hi have you got the link to the contribution your using? Also, are you using MS2.2 ?? I found the contrib I had added for ordering from the products listing. It took a lot of brain melting work but I managed to get it back functioning again. Here is where I'm at.... In the product listing ordering is possible just like I had it before this. If you click on a product and go to it's page it will tell you in the upper right corner what the volume discounts are. Yay! The only problem I have now is a problem I have always had with the ordering contrib, http://www.oscommerce.com/community/contributions,1129 which is in the products listing on the header of the table instead of Product, Price, Quantity, etc it says TEXT_PRODUCT TEXT_MODEL TEXT_OPTIONS TEXT_PRICE TEXT_AMOUNT_BUY I was told there is something missing from the languages but I have no idea where to change this. This has plagued me ever since I first added this and it's still annoying. However compared to the complete non-functioning of my site I was having before it is minor. I would like to get rid of altogether to model column if possible since it's totally unnecessary.
stephaniezara Posted March 3, 2004 Author Posted March 3, 2004 I'm on a roll. :D I found the place to edit the column headers. Yay! Now the only thing that I am stuck with is how to reflect the volume discount in the product listing. Since I dont want that question to be buried deep in here I will start a new thread for that. :P I think it's so great that you more knowledgable people take the time to help us regular folks out. Thanks so much!!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.