Latest News: (loading..)

ecartz

♥Ambassador
  • Content count

    1,980
  • Joined

  • Last visited

  • Days Won

    3

ecartz last won the day on December 3 2012

ecartz had the most liked content!

7 Followers

About ecartz

Profile Information

Recent Profile Visitors

36,929 profile views
  1. You say both tep_get_prid and tep_get_uprid. The tep_get_prid function should work anywhere if you have an uprid and want just the prid. So I'm assuming that you mean tep_get_uprid, that you have a valid prid (product_id), and that you are having trouble working out the parameters. If you look in includes/classes/order.php, you will see something like $this->products[$index]['attributes'][$subindex] = array('option' => $Qattributes->value('products_options'), 'value' => $Qattributes->value('products_options_values'), 'prefix' => $Qattributes->value('price_prefix'), 'price' => $Qattributes->valueDecimal('options_values_price')); But if you look in includes/functions/general.php, you will see something like foreach ($params as $option => $value) { So you need to iterate over the attributes for that product and do something like $params = []; foreach ($order->products[$index]['attributes'] as $attribute) { $params[$attribute['option']] = $attribute['value']; } $prid = tep_get_uprid($order->products[$index]['id'], $params); I haven't tested this, but hopefully this should guide you towards what you need. If you really meant tep_get_prid and not tep_get_uprid, then you shouldn't need it in those places. Just use $order->products[$index]['id'] directly. If this doesn't help, please post the code that you are trying, what you expect it to do, and what it actually does, including any error messages.
  2. Depending on the field, you may be able to make it compulsory in the Admin area. If not there, you make it compulsory in the page that processes the form. Here's the code that makes the email compulsory in create_account.php (from 2.3.3.4 but likely the same in all 2.3.x): if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR); } elseif (tep_validate_email($email_address) == false) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } else { $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); $check_email = tep_db_fetch_array($check_email_query); if ($check_email['total'] > 0) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS); } } Note that the ENTRY_EMAIL_ADDRESS_MIN_LENGTH is something that is set in the Admin. To make something that is currently compulsory so that it is optional, you'd have to make code like this not run. Note that it would be a very bad idea to make the email address not compulsory. It's also marked as required by translated text: . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); And from the language file, english.php : define('ENTRY_EMAIL_ADDRESS_TEXT', '*'); If you delete the * from that, it will no longer display the requirement span.
  3. You don't need the database to be on the cloud to do this. You don't even need it to be on a separate server from the web server (although there are also times where that is helpful). If you have a dedicated server (which can be an EC2 or similar instance), you can host multiple domains from the same server and run a single database on it. Some CPanel style hosts may be able to allow you to share a database among multiple domains as well. I've certainly been able to do it with subdomains (something like www.oscommerce.com and forums.oscommerce.com). I don't have experience with the Google offerings. But with Amazon (AWS), you can run an RDS (Relational Database Service) instance and one or more EC2 (Elastic Compute Cloud) instances that access it. The RDS instance can be configured to only allow access to the EC2 instances, so you don't have external agents trying to connect to your database. I managed a Drupal site like this, with Amazon RDS and load-balanced web servers that could access it. As I recall, the bill was something like a $1000 a month for a relatively busy site. We were using the largest database ($400) and web server ($400) instances as well as the occasional second web server and other test servers and storage. Prices may be out of date. A smaller site could presumably run on smaller instances. The management tools were awesome. We could easily track how busy the servers were and other issues. Backing up the database was as simple as pushing a button or scheduling a regular activity. The way that Amazon works, you don't need to have all the web servers running at once. So when it is slow or normal, you can run a single instance. But when it is busy, you can add a second instance behind the same load-balanced IP. It will split the traffic between them. Since both go to the same database instance, the user won't be able to tell that there are multiple front ends. One challenge might be that for HTTPS to work, you need separate IP addresses and/or ports for each SSL domain. If your microsites can share the same secure domain behind them, then that would certainly work. But if not, you might need to pay extra to get more IP addresses and proxy them back to separate ports. I remember IPs as a limitation that we never needed to fix. We just worked around it, as we didn't need more public IPs. There were just times they would have been convenient. I do not think it is a good idea to try to run a Google database with a web server somewhere other than Google. The latency can add up. If you're low traffic enough that it doesn't matter, you're probably also low traffic enough to run your web server on the same host as the database. It's a little more complicated to manage (no CPanel to manage domains, etc.), but they'd essentially provide you your own virtual server. Or as I said earlier, some CPanel style hosts will allow you to share a database across multiple domains.
  4. Have you tried: 1. Reading the logs to see what they show. 2. Using the Contact Us form to send yourself a test message. Those seem like a good place to start troubleshooting.
  5. Have you checked Spam and All Mail? Sometimes the validation emails can get stuck in places like those. I had problems like that when they first switched to the new tab interface, as it was helpfully hiding something under Social. So my suggestion is to try it again and then check under Spam and All Mail to see if the notification is stuck in either place.
  6. I don't understand what you are asking. Are you talking about a specific block of code? A file? Or something else?
  7. if (substr($payment_modules->selected_module, 0, 6) == 'paypal') { This would catch any of the modules that start 'paypal', e.g. PayPal Standard, PayPal Express, etc. If you just want to catch Standard if ($payment_modules->selected_module == 'paypal_standard') { This is from memory, so if it doesn't work, try echoing the value to the screen. Note that you have to do this after the payment modules object is created. It won't work at the top of the file. // load the selected payment module require(DIR_WS_CLASSES . 'payment.php'); $payment_modules = new payment($payment);
  8. Try function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') { if ($request_type != 'SSL'){ $src = str_replace(DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES, 'http://www.store.xxx.com' . DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES, $src); } If that doesn't work, you would need to post the relevant section of configure.php. I.e. the DIR_WS_ and HTTP_SERVER entries. You also might post more details about what you tried and what actually happened.
  9. But then we'd have to have some way of deciding what data was required. So we'd need an extra level of database relations that represented whether page A requires a particular piece of configuration. Then we'd need to load both global configuration (required on every page) and page configuration (required for the current page) plus functional configuration (required for whatever we're doing at the time). And of course, we'd sometimes get it wrong. Plus, there are some pieces of configuration that one store uses only on a few pages while another store might use on every catalog page. Case in point: an add-on that shows shipping fees in the cart info box. That makes shipping configuration required on every catalog page. Yet the vanilla sites only require shipping configuration during the checkout process. So that add-on would have to alter a piece of configuration from being checkout specific to being globally available (at least in catalog). That change would need to persist through a site update. The big advantage of the current system is that it is very simple. Load everything all the time. We never have to worry about missing configuration unless it is actually missing from the database. If we change that, we make it harder for most add-on developers, as configuration that used to be globally available now has to be loaded specially.
  10. That column's already there (value): CREATE TABLE orders_total ( orders_total_id int unsigned NOT NULL auto_increment, orders_id int NOT NULL, title varchar(255) NOT NULL, text varchar(255) NOT NULL, value decimal(15,4) NOT NULL, class varchar(32) NOT NULL, sort_order int NOT NULL, PRIMARY KEY (orders_total_id), KEY idx_orders_total_orders_id (orders_id) ) CHARACTER SET utf8 COLLATE utf8_unicode_ci;Note that it doesn't make the mistake of limiting to just two digits after the decimal point. Four are required for some circumstances. In particular for currencies that have three digits after the decimal point and those times when an extra digit is needed. One reason why the text column exists is that we don't want the order total display to change if we make a change to how a currency displays or to how an order total displays. This makes the display static and consistent. This is common in orders database tables. It maintains consistency. Note also that this allows for displays that have both bold and standard text. If you pull the HTML tags out of the text field, then we lose the ability to set the display at order time as well as the ability to have different displays for different modules. You keep describing this as if it were a small change. It's not. You are talking about fundamentally changing orders_total displays from being generated at order time to being generated at display time. The current system is robust in the face of changes to currencies and to order total modules. Even if an order total module is deleted entirely, the entry will still display correctly. Under your system, you can never remove an order total module without messing up the displays of old orders. I'm sorry that you feel like the community is ignoring obvious ideas. The problem is that changes like this have consequences. Not all of the consequences are immediately obvious. Running manual commands in phpMyAdmin is not sufficient. An update needs to be in the form of an update script so that non-technical people can use it.
  11. In the list of advantages, I don't see any that don't work in the current situation. What osCommerce currently has is a setup where store owners can require cookies but do not have to do so. If we retain things as is, then a store owner can get by enabling cookies (and making any other relevant configuration changes). From a development standpoint, I think that the list of advantages is shorter. The only one that I can see is that it makes the code simpler. However, if we still have to support session IDs in the URL for the secure/insecure switch, then I'm not sure that it matters. The code stays complex (although we do save a configuration check). Obviously, the disadvantage is losing the option of allowing URL passed session IDs.
  12. It's not clear to me why the language would make a difference. None of the new SQL queries are language dependent. Also, if I try it on my test site, it works (at least in Spanish and German). Perhaps the problem would be more obvious if you posted a link to the page that is not working?
  13. The relevant section of code is if ($check_email['total'] > 0) { $error = true; $email_exists = true; $messageStack->add('checkout_address', sprintf(ENTRY_EMAIL_ADDRESS_EXISTS_ERROR, tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL'))); } However, I don't know that there is a simple fix that preserves the advantages of the current system. One possibility would be to delete the previous row or change the email address in it so that the new row could be added. That's what the Purchase without Account contribution does. E.g. something like if ($check_email['total'] > 0) { tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); } Note: I haven't tested this in any way.
  14. The name of the add on is Checkout Redux.
  15. As written, guests should not be able to see My Account, as they don't have an account and wouldn't be able to use any of the My Account links. No historical orders, no password to change, etc. The only thing that they could do would be to edit addresses, and there is already provision in checkout for that.