Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PaulOB

Archived
  • Posts

    47
  • Joined

  • Last visited

Everything posted by PaulOB

  1. Enter product prices in different currencies - Help with product currency in MVS... I have set up my store to automatically update exchange rates several times a day so products can be displayed in various currencies. However, I have vendors which supply goods in different currencies e.g. USD, EUR and GBP. There have been very large fluctuations in exchange rates recently, so what I would like to do is be able to set the Net Product Price in the same currency that the vendor supplies the goods to me. The great majority of goods are bought in my default currency, but recently I have found I could easily have made losses on products that are not bought in the default currency due to exchange rate movements... Can this be done by creating a new column (let's say products_currency) in the products table and making changes in admin/categories.php ( and I suppose admin/includes/languages/.../categories.php as there'd need to be a box to enter the currency or left blank ) ? Can anyone provide the code to do this?
  2. Suggested improvement - MVS Product Attributes - vendor option price I was PM'd today regarding making a Product Attributes mod work with MVS... The mod is one which allows weight differences to be applied to product attributes... I've been using MVS for over 2 years now, and had always just lived with the minor annoyance that the purchase order e-mailed to the vendor didn't take into account any price modifier when product attribute options resulted in a price difference - i.e. the purchase order would always quote the base price. On numerous occasions vendors have e-mailed me about incorrect amounts been shown on the purchase order e-mail they received because of this. Anyway, the add weight to product attributes looks quite neat (http://www.oscommerce.com/community/contributions,1622) and I thought a similar approach could be adopted to MVS that could allow a vendors product attribute price change i.e. altering SQL table products_attributes to add a column for the price the vendor charges (or deducts) for the option. The same sort of code changes could be applied to catalog/admin/product_attributes.php & catalog/admin/includes/languages/english/product_attributes.php ; and a minor change in catalog/admin/vendor_email_send.php As it's so long since I've checked these forums I thought I'd see if anyone has done this already? I thought Craig or Jim may have some ideas and was surprised that MVS is still version 1.1 !!! Paul.
  3. Hi Daniel, I've done a modified zones module that will work with states as well as countries. I'll upload to the contributions section. Best regards, Paul.
  4. I'm trying to create a shipping module for MVS based on the zones module. It is for vendors who ship by haulage where their shipping rates are determined by part of the UK postcode. Since uploading this module to the vendors_shipping folder and associated language file to includes\languages\english\modules\vendors_shipping, I am getting this error message when I click manage vendors: Call to undefined function: zones() in /.../admin/vendor_modules.php on line 143, referer: http://.../admin/vendors.php?selected_box=vendors&page=1&vendors_id=3 These are the files I've uploaded: http://www.biofuelsystems.com/other/mvspostcodes.zip The zones.php module was working fine prior to this. Any ideas what's gone wrong??
  5. PaulOB

    Protx Direct v2.22

    Thanks Tom. With Protx Form the customer would have to select the type of card they are using before they are directed to Protx when they could in theory use another type of card i.e. select debit card in the online store (no charge) and pay with a credit card when they get to Protx (instead of paying the surcharge) Would agree Protx Direct is a better method, and I think ultimately I will be switching to it regardless of whether I can get the surcharge system working they way I'd like it to... For my store there are items where the margin is so low that the fees charged on certain credit cards (e.g. commercial credit cards) swallow up almost all the profit. I'd like to be able to set whether a credit card surcharge is applied on any given item as for the great majority of items I wouldn't have to do it... All the best, Paul.
  6. PaulOB

    Protx Direct v2.22

    It would be even better to be able to apply credit card surcharges to certain items only, but clearly this will be quite complicated as a separate order total for items to which the surcharges apply would have to be passed to the payment module...
  7. PaulOB

    Protx Direct v2.22

    The margins on some the items I am selling are very low (less than 4% in some cases) and for this reason I would like to be able to apply surcharges for certain types of card. At the moment I am using Protx Form, but would like to start using Protx Direct as presumably there is scope to modify this module to allow this - ideally an extra menu from the admin screen where either flat rate or percentage surcharges could be applied for different card types. Can anyone help with this? Paul.
  8. Hi Jim, Just a quick note to point out that a bug you had previously found in the admin/invoice.php file whereby product attributes / options were not displaying for all but the first product ordered seems to have crept back in to the contribution... ref: Almost at the bottom of this page - http://www.oscommerce.com/forums/lofiversion/i...01973-1050.html - you made this code change: <code>echo '<br><nobr><small> <i> - ' . $order->products[$l]['orders_products'][$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['orders_products'][$i]['attributes'][$j]['value']; </code> A close examination of that line shows that the first index on the Value is an i where it should be l. Another reason why I won't use single-letter variables. Here's the correct line: <code>echo '<br><nobr><small> <i> - ' . $order->products[$l]['orders_products'][$i]['attributes'][$j]['option'] . ': ' . $order->products[$l]['orders_products'][$i]['attributes'][$j]['value']; </code> All the best, Paul.
  9. PaulOB

    Protx Direct v2.22

    Hi Vger, I'm not sure if you're replying to me, but I'm using VSP Form and have never had to set up a list of IP addresses. Paul
  10. PaulOB

    Protx Direct v2.22

    Hi, I've just moved my site & shop to a new server, and have tried some test transactions, but it no longer gets back to the checkout success page - just a blank screen... Can't understand what the problem could be as it was working fine prior to this... Can't think what might have changed. Any help gratefully received, as this is going to cause big problems - the shop has been live for some time... Paul.
  11. In checkout_process, how can I include the quoted vendor shipping rate in the e-mail to the vendor? (I want the vendor to be able to check each time that we haven't undercharged for shipping) Cheers, Paul.
  12. For now, I have created a new funtion in general.php so that this can be done: // Add tax to a products price for invoices function tep_add_tax_invoice($price, $tax) { global $currencies; if ( $tax > 0 ) { return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + tep_calculate_tax($price, $tax); } else { return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']); } } Not sure it's the best way to go about it though... - Paul -
  13. I think I've found the source of my problem, but I'm not sure what to do about it... I want to be able to show the prices of items on the store ex-tax, but I still need to show the inc-tax amount on the invoice. If I set Display Prices with Tax to false, the invoice shows Price(ex) as the samle as Price(inc) and Total(ex) the same as Total(inc)... In admin/invoice.php the inc tax amount is calculated using tep_add_tax. In the definition of tep_add_tax in includes/functions/general.php, it only functions if DISPLAY_PRICE_WITH_TAX == true Can you suggest another way of doing this so that I can still show inc tax amounts on the invoice even if my store prices are shown ex tax ?? Cheers, Paul.
  14. Hi Jim / Craig, I don't know if this has anything to do with MVS, or if it's just my setup with its peculiarities and lack of register globals... Anyway the problem I'm having concerns tax: If I set Display Prices with Tax in admin to false it seems to cause these problems: - Price(inc) and Total(inc) on the invoice (viewed from admin -> customers -> orders) are the same as Price(ex) and Total(ex), yet Sub-total: and Total: correctly show the price including tax - At checkout_confirmation it does not show tax (only Sub-Total, Shipping & Total), yet the Total amount correctly shows the amount including tax. I've spent almost an entire day trying to track down the source of this error and need help! Thanks again, Paul.
  15. Hi Craig, I've made a couple of minor changes, although there is the problem of a zone_code being the same as countries_iso_code_2. This won't be a problem here in the UK, but there would be quite a few clashes in the US - e.g. the India / Indiana example. Currently, I've got it to use zone_code if this has been set (otherwise state name), and it sets up $shipping_method depending on whether shipping is to a state or country... I think the way forward would be to create a new type of vendors_shipping zones module altogether along the lines of what you have suggested. Lots of other improvements could be introduced too, like percentage support and the ability to select whether the cost is calculated from weight, cost of order or number of items etc. Anyway, here's what I have at the moment: $dest_country = $order->delivery['country']['iso_code_2']; //Zones within countries $dest_state = $order->delivery['state']; $dest_zone_id = $order->delivery['zone_id']; if ($dest_zone_id > 0) { $zone_query = tep_db_query("select distinct zone_code from " . TABLE_ZONES . " where zone_id = '" . $dest_zone_id . "'"); if (tep_db_num_rows($zone_query) == 1) { $dest_zone_n = tep_db_fetch_array($zone_query); $dest_state = $dest_zone_n['zone_code']; } } $state_shipping = 0; //Zones within countries End $dest_zone = 0; $error = false; for ($i=1; $i<=$this->num_zones($vendors_id); $i++) { $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $vendors_id . '_' . $i); $country_zones = split("[,]", $countries_table); if (in_array($dest_country, $country_zones)) { $dest_zone = $i; break; } } if ($dest_zone == 0) { //Zones within countries for ($i=1; $i<=$this->num_zones($vendors_id); $i++) { $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $vendors_id . '_' . $i); $country_zones = split("[,]", $countries_table); if (in_array($dest_state, $country_zones)) { $dest_zone = $i; $state_shipping = 1; break; } // rest of the world if ($countries_table == 'WORLD') { $dest_zone = $i; break; } // rest of the world eof } } //Zones within countries End and this minor change to the wording of the table: tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . $vendors_id . "', 'Zone " . $i ." Countries or States', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $vendors_id . "_" . $i . "', '" . $default_countries . "', 'Comma separated list of either State or two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())"); All the best, Paul :)
  16. Hi Craig, I've plagiarised a couple of contributions to allow states to be used as zones and have a rest of the world zone. Credit for these goes to Jorge Suarez - Regions Based Rates Shipping Module and Radu Manole - Rest of the world addon. I think there must be a neater way to do this though. For instance, I would rather it used the zone_code abbreviation instead of the full name of the state - can you think of a way to do this? With this mod, if rest of the world zone is needed - WORLD zone should be last... There is a problem in that one customer might abbreviate the state to IN whereas another might enter Indiana. To get around this I have had to use another contribution: Country-state selector ( http://www.oscommerce.com/community/contributions,2028 ) so the customer chooses the state from a dropdown list rather than entering it freehand... Otherwise you could end up charging a customer to ship to India rather than Indiana !! There are quite a few problems actually, so if it could be done, it would be much better to have to specify applicable states within a country e.g. US:+DL;FL;GE;IN or be able to specify a country with the exception of certain states e.g. US:-DL;FL;GE;IN Anyway, here's what I have put in: $dest_country = $order->delivery['country']['iso_code_2']; //Zones within countries $dest_state = $order->delivery['state']; //Zones within countries End $dest_zone = 0; $error = false; for ($i=1; $i<=$this->num_zones($vendors_id); $i++) { $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $vendors_id . '_' . $i); $country_zones = split("[,]", $countries_table); if (in_array($dest_country, $country_zones)) { $dest_zone = $i; break; } } //Zones within countries if ($dest_zone == 0) { for ($i=1; $i<=$this->num_zones($vendors_id); $i++) { $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $vendors_id . '_' . $i); $country_zones = split("[,]", $countries_table); if (in_array($dest_state, $country_zones)) { $dest_zone = $i; break; } // rest of the world if ($countries_table == 'WORLD') { $dest_zone = $i; break; } // rest of the world eof } } //Zones within countries End
  17. Hi Craig. There is a contribution out there to include a "rest of the world" zone... You name the last zone "WORLD" and enter a shipping table for it. The url for the contribution is: http://www.oscommerce.com/community/contributions,2458/ In includes/modules/vendors_shipping/zones.php, after this bit of code: for ($i=1; $i<=$this->num_zones($vendors_id); $i++) { $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $vendors_id . '_' . $i); $country_zones = split("[,]", $countries_table); if (in_array($dest_country, $country_zones)) { $dest_zone = $i; break; } Add this: // rest of the world if ($countries_table == 'WORLD') { $dest_zone = $i; break; } // rest of the world eof Still think it would be great to be able to have shipping zones within countries though. All the best, Paul
  18. I think the zones shipping module could be improved by allowing zones within a country to be specified as shipping zones. An operator ":+" in the example below could be used to include zones within a country in that shipping zone, ":-" to exclude specific zones within a country from the shipping zone... Zone 1 countries: ES:+(Lugo,Madrid) Zone 1 table: 3:8.50,7:10.50,99:20.00 Zone 2 countries: ES:-(Lugo,Madrid),PT Zone 2 table: 3:8.50,7:10.50,99:20.00 Zone 3 countries: FR Zone 3 table: 3:8.50,7:10.50,99:20.00 Any thoughts? - Paul -
  19. It's Ok. Seemed to have fixed it by moving the MVS Vendors e-mail bit to before the email confirmation. Cheers, Paul.
  20. Hi Craig, There's a little HTML error in catalog/checkout_process.php... I didn't spot it as I was looking for globals problems and couldn't see the woods for the trees. I think I've become obsessed with them!! The table listing the items ordered from the vendor wasn't coming out properly. This (line 364 - 369 if unmodified): $email = $email . '<tr><td>?' . $vendor_products[$l]['vendor_orders_products'][$i]['Pqty'] . '</td><td>?' . $vendor_products[$l]['vendor_orders_products'][$i]['Pname'] . '<br>??<i>Option<br> ' . $product_attribs . '</td><td>?' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_id'] . '</td><td>?' . $vendor_products[$l]['vendor_orders_products'][$i]['Pmodel'] . '</td><td>?' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price'] . '</td><td>' . $vendor_products[$l]['vendor_orders_products'][$i]['Pcomments'] . '</b></td></tr>'; Should read this: $email = $email . '<tr><td>?' . $vendor_products[$l]['vendor_orders_products'][$i]['Pqty'] . '</td><td>?' . $vendor_products[$l]['vendor_orders_products'][$i]['Pname'] . '<br>??<i>Option<br> ' . $product_attribs . '</i>' . '</td><td>?' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_id'] . '</td><td>?' . $vendor_products[$l]['vendor_orders_products'][$i]['Pmodel'] . '</td><td>?' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price'] . '</td><td><b>?' . $vendor_products[$l]['vendor_orders_products'][$i]['Pcomments'] . '</b></td></tr>'; Anyway, wondering if you can help me with another problem? Nothing to do with your code, I'm trying to integrate the 'Fancier Invoice & Packing Slip' contribution ( http://www.oscommerce.com/community/contributions,2861 ) They modify checkout_process.php, so that a nicer looking HTML invoice is sent out to the customer. These are the changes: Beneath: // lets start with the email confirmation They add: // START HTML Invoice if (EMAIL_INVOICE == 'true') { require(DIR_WS_MODULES . EMAIL_INVOICE_DIR . FILENAME_EMAIL_INVOICE); } else { // END HTML Invoice and directly above: // load the after_process function from the payment modules $payment_modules->after_process(); They add: // START HTML Invoice } // END HTML Invoice Unfortunately adding this routine prevents the vendor email from being sent automatically. I only started using osCommerce a couple of months ago and am still very unfamiliar with the code (and the vast arrays of variables being juggled around) Wondering if you could suggest anything to help me integrate this part of the fancier invoice package? Many thanks, Paul.
  21. Hi Craig, I think my post got buried beneath reams of code! Was just wondering if you can help me with a problem with the email sent to the vendor: I just did a test order and ordered two items from the same vendor. I wanted check that the e-mail to the vendor contained all the details (Qty, Product name, Item Code/Number, Product Model, Per Unit Price, Item Comments) as I had added some item comments. The e-mail to the vendor contained all the details, but the second item was outside the table. The table listing the items in the email to the vendor seemed to be missing the row for the second item. I thought it might be this line: if (isset($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']) && (sizeof($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']) > 0)) { Any help appreciated. Cheers, Paul.
  22. I have to work with register globals disabled, and have used the following mod: http://www.oscommerce.com/community/contributions,2097 Do you think this package will work with my version? Thanks, Paul.
  23. Hi Craig, It's a very minor point, and may well just be my setup - I more or less automatically blame everything on globals! I just did a test order and ordered two items from the same vendor. I wanted check that the e-mail to the vendor contained all the details (Qty, Product name, Item Code/Number, Product Model, Per Unit Price, Item Comments) as I had added some item comments. The e-mail to the vendor contained all the details, but the second item was outside the table. The table listing the items in the email to the vendor seemed to be missing the row for the second item. $email = $email . '<table width="75%" border=1 cellspacing="0" cellpadding="3"> <tr><td>Qty:</td><td>Product Name:</td><td>Item Code/Number:</td><td>Product Model:</td><td>Per Unit Price:</td><td>Item Comments: </td></tr>'; for ($i=0, $n=sizeof($vendor_products[$l]['vendor_orders_products']); $i<$n; $i++) { $product_attribs =''; if (isset($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']) && (sizeof($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']) > 0)) { for ($j = 0, $k = sizeof($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']); $j < $k; $j++) { $product_attribs .= ' ' . $vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes'][$j]['option'] . ': ' . $vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes'][$j]['value'] . '<br>'; } } $email = $email . '<tr><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['Pqty'] . '</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['Pname'] . '<br> <i>Option<br> ' . $product_attribs . '</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_id'] . '</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['Pmodel'] . '</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price'] . '</td><td>' . $vendor_products[$l]['vendor_orders_products'][$i]['Pcomments'] . '</b></td></tr>'; } } $email = $email . '</table><br><HR><br>'; What do you think? - Paul -
  24. I think I've got the whole thing working without register globals now. In admin/prods_by_vendor.php, I've linked 'vendors_id': require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); link_post_variable('vendors_id'); $currencies = new currencies(); $line2 = $line; In admin/orders_by_vendor.php, I've linked 'vendors_id' and 'status': require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); link_post_variable('vendors_id'); link_post_variable('status'); $currencies = new currencies(); Assuming I didn't forget to include any other Register Globals mods, do you think there are any other areas of concern? All the best, Paul.
×
×
  • Create New...