Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Yari Gio

Archived
  • Posts

    25
  • Joined

  • Last visited

Profile Information

  • Real Name
    Yari

Yari Gio's Achievements

  1. I was wondering if any one can help me. I have the latest version of this contribution installed on a modified shopping cart. It's almost working perfectly, the only part that is not "working" is the capture and display of the correct price in the "make an offer" page that allows a client to submit the offered price. Right now the product price is $50. For some reason the "Make an offer page" showed "$0" then I applied a change to line 45 of the make_an_offer.php as suggested earlier in this forum and now it's showing: So something is off for sure in the way it gets the price and converts it to "show" it. This is the code from the "make_an_offer.php" (I had to cut up the "make_an_offer.php" to work with my template system but that part is not affecting it i'm sure....) <?php /* $Id: make_an_offer.php,v 1.00 2005/03/15 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2005 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MAKE_AN_OFFER); // add customer details (1/1) paulm 2004/04/02 // if (tep_session_is_registered('customer_id')) // { // $name = $customer_first_name . ' ' . $customer_last_name; // $email = $customer_email_address; // } // end add customer details if (!isset($HTTP_GET_VARS['products_id'])) { $productid = $originalproductid; } else { $productid = $HTTP_GET_VARS['products_id']; } // Get the product info $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$productid . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); $rate = $currencies->currencies[$currency]['value']; if ($new_price = tep_get_products_special_price($product_info['products_id'])) { // $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); // Price without currency symbols $products_price_clean = tep_round(tep_add_tax($new_price * $rate,tep_get_tax_rate($product_info['products_tax_class_id'])),$currencies->currencies[$currency]['decimal_places']); } else { $products_price = $currencies->display_price($productid,$product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); // Price without currency symbols $products_price_clean = tep_round(tep_add_tax($product_info['products_price'] * $rate,tep_get_tax_rate($product_info['products_tax_class_id'])),$currencies->currencies[$currency]['decimal_places']); } $error = false; if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) { $name = tep_db_prepare_input($HTTP_POST_VARS['name']); $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']); $remarks = tep_db_prepare_input($HTTP_POST_VARS['remarks']); $newprice = tep_db_prepare_input($HTTP_POST_VARS['newprice']); $originalproductid = tep_db_prepare_input($HTTP_POST_VARS['originalproductid']); $originalprice = tep_db_prepare_input($HTTP_POST_VARS['originalprice']); $subject = tep_db_prepare_input($HTTP_POST_VARS['subject']); $subject2 = tep_db_prepare_input($HTTP_POST_VARS['subject2']); if (tep_validate_email($email_address)) { // Calculate the lowest offer accepted depending on the percentage setting $maxlowoffer = tep_round(($originalprice - ($originalprice * (MAO_MAX_OFFER_PERCENTAGE_ALLOWED/100))),$currencies->currencies[$currency]['decimal_places']); // Manipulate the offer price so it always is in US notation before compare // This must be done because the INPUT field looses the decimal values // when using a comma for decimal seperator // Underneath also strips all points and commas from the value typed by // the customer to prevent all kind of problems with the calculation // First split the $newprice in a part without and with decimal places // Check if a decimal point or comma is used at all if (substr($newprice,strlen($newprice)-3,1) == '.' || substr($newprice,strlen($newprice)-3,1) == ',') { $newprice_before = substr($newprice,0,strlen($newprice)-3); $newprice_after = substr($newprice,strlen($newprice)-2); } else { $newprice_before = $newprice; $newprice_after = '00'; } // Remove all commas and points for the non-decimal value given $newprice_before = str_replace('.','',$newprice_before); $newprice_before = str_replace(',','',$newprice_before); // Put all back together again $newprice = tep_round($newprice_before . '.' . $newprice_after,$currencies->currencies[$currency]['decimal_places']); if ($maxlowoffer <= $newprice) { // (Re)create the right format for the email $newprice = number_format(tep_round($newprice,$currencies->currencies[$currency]['decimal_places']), $currencies->currencies[$currency]['decimal_places'], $currencies->currencies[$currency]['decimal_point'], $currencies->currencies[$currency]['thousands_point']); $subject .= ' ' . $currencies->currencies[$currency]['symbol_left'] . $newprice . ' ' . $currencies->currencies[$currency]['symbol_right'] . '\n' . EMAIL_DIVIDER . '\n\n' . EMAIL_USER_REMARKS . '\n\n'; $subject = str_replace('\n',chr(13),$subject); $subject2 .= ' ' . $currencies->currencies[$currency]['symbol_left'] . $newprice . ' ' . $currencies->currencies[$currency]['symbol_right'] . '\n\n' . EMAIL_DIVIDER . '\n' . EMAIL_USER_REMARKS . ' ' . $name . '\n' . EMAIL_DIVIDER . '\n'; $subject2 = str_replace('\n',chr(13),$subject2); tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT_ADMIN, $subject2 . $remarks, $name, $email_address); if ($HTTP_POST_VARS['sendemail'] == true) { tep_mail($name, $email_address, EMAIL_SUBJECT_CUSTOMER, $subject . $remarks, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } tep_redirect(tep_href_link(FILENAME_MAKE_AN_OFFER, 'action=success')); } else { $error = true; // (Re)create the right format for display $newprice = number_format(tep_round($newprice,$currencies->currencies[$currency]['decimal_places']), $currencies->currencies[$currency]['decimal_places'], $currencies->currencies[$currency]['decimal_point'], $currencies->currencies[$currency]['thousands_point']); $messageStack->add('lowoffer', ENTRY_LOW_OFFER_CHECK_ERROR); } } else { $error = true; $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } } Any help will be greatly appreciated. Thank you.
  2. Hello every one, I am using USPS shipping module, its working awesome and i've not had any problems with most of my items. Unfortunatly i need to be able to sell some things with NO shipping cost, but even if i set the weight to 0 USPS module is adding a little bit of weight and thus charging me shipping. I checked the admin area for shipping but i have tare weight and package weight to 0. Any one have any idea on this ? Thanks.
  3. I thank con4mity for all his help, I did want to expland one the administration change he made just with my own discovery i had found since con4mity asked me to post this :D I noticed several things it does not seam that the last part actualy runs for the admin portion of the oscommerce.slq. Let me explan when install everything as per the new instructions i can not log in. So i looked at myphpadmin and noticed that the products table did not have a `store_id` line in it. So what i did was try to run via my myphpadmin just the first section: But with the change that con4mity mentioned in the post above things should be all right now.
  4. hello ronda, well since i've made such use of these boards in the last few days lets see if i can help you in return. Did you use these instructions http://www.ecorey.com/mall_instr_update_plus_admin.txt or the original ones with this contribution ? If you used the original txt just get a clean copy of oscom and of virtual mall and use the instructions in this link above. They will get you a bit further and if you run in to any more problems just post again and i'll try to help.
  5. Thank you Matt, I changed that and had to take out an extra "}" the code looks like this now and it worked !!! Now... the last thing i need to figure out, how do i make it so insted of seeing one big store i can access the catalog and front page of one store at a time. :)
  6. Humm almost got it running. When i got to check out i get this error: I pulled up from section 215 to 232 of my checkout_process.php: The line that is giving it the error is: " if (!is_array($store_totals[$store_index])) {" I also tried changing the file to this setup: But it gave the same error on the same line. Any ideas ? Thanks agian guys.
  7. Haa that worked perfectly. The only problem was that at the end i could not log in with admin/admin so i ran under slq: DROP TABLE IF EXISTS administrators; CREATE TABLE administrators ( administrators_id int(11) DEFAULT '0' NOT NULL auto_increment, administrators_username varchar(20) NOT NULL, administrators_password varchar(40) NOT NULL, administrators_allowed_pages varchar(255) DEFAULT '*' NOT NULL, PRIMARY KEY (administrators_id) ); INSERT INTO administrators VALUES ( '1', 'admin', '21232f297a57a5a743894a0e4a801fc3', '*'); and then ALTER TABLE `administrators` ADD `store_id` INT( 11 ) DEFAULT '0' NOT NULL ; and that worked perfect. I'm in and it looks like everything is working perfectly. Thanks for all the help.
  8. con4mity, thanks a TUN. Give me a few mins and i will give this a try and report back.
  9. Alright!!! Got some where, I was able to get the admin module working. Now i just need to figure out why the products category is not getting created. Any one have any insight as to where i should look for an answer ? This is the error i get when i look at the admin module: 1146 - Table 'velond5_oscom.products' doesn't exist select count(*) as count from products where products_status = '1' [TEP STOP] And this is on the catalog page: 1146 - Table 'velond5_oscom.products' doesn't exist select count(*) as total from products p, products_to_categories p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '1' [TEP STOP] Also, if i manage to get to the stores page i get this message: TEXT_DISPLAY_NUMBER_OF_STORES So I figure that for some reason the create part of the tables stops short at products or something ... Thanks ahead for the help.
  10. Just realized, do i need to have a difirent version of osc comm ? i have 2.2 ME (the clean download from oscommerce.com.
  11. I just ran the installation with out making any mods (so basicaly a tottaly clean installation of OScom) and the products table was created perfectly. I'm wondering if there is just something in the changes that are made for the store that i'm doing wrong. Also would i be better off not installing the admin part of this contribution and getting a newer version of multi admin/ access ?
  12. What script should i be running after running the normal installation of OSCom ? and do you rember off hand what changes are needed to the administrator slq to get things to run right ? Thanks
  13. Alright, deleted the data base and started over again. Installed all the files from the download (virtual_mall v 1.2) in to the respective category. Then made all of the changes as per instructions and then i tryed to upload and run Administrators.sql and i get this error in myphpadmin: SQL-query : ALTER TABLE `products` ADD `store_id` INT( 11 ) DEFAULT '0' NOT NULL AFTER `manufacturers_id` MySQL said: #1146 - Table 'velond5_oscom.products' doesn't exist And if i try to get to the catalog i get the catalog page but on the left side all i see is: Categories 1146 - Table 'velond5_oscom.products' doesn't exist select count(*) as total from products p, products_to_categories p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '1' [TEP STOP] And if i try to log in to the admin area i do get the admin log in screen now but i do not know the pass word or log in name and admin@localhost / admin does not work. Sorry for the newbee questions and thanks upfront for all your help.
  14. I did not get any kind of errors during the installation but im wondering if it's part of the manula changes i made to the files. I will try to remake them this morning and hopefully it goes smooth. I'll let you know in 20.
  15. Arrg, Big problems, after making all the modifications to the files as requested in mall_instr_update.txt then installed oscom as normal but when i go in to the catelog i get: Categories 1146 - Table 'velond5_oscom.products' doesn't exist select count(*) as total from products p, products_to_categories p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '1' and when i open the admin tool i get: Administration | Online Catalog | Support Site osCommerce Support Site Support Forums Mailing Lists Bug Reports FAQ Live Discussions CVS Repository Information Portal Orders Pending: 0 Processing: 0 Delivered: 0 1146 - Table 'velond5_oscom.products' doesn't exist select count(*) as count from products where products_status = '1' [TEP STOP] I have no idea why im getting that. Also there was no instructions as to what to do with the rest of the files in the catalog folder nor what to do with "Administrators.sql". What should i be doing with these files and what might of whent wrong above ? Please help
×
×
  • Create New...