Latest News: (loading..)


  • Content count

  • Joined

  • Last visited


About amseek

  • Birthday 06/29/1972

Profile Information

  • Real Name
    Art Main
  • Gender
  • Location
    Santa Cruz, CA - USA
  • Interests
    Websites, DJ, peanut-butter n' jelly sandwiches. Currently, enjoying dusty wiring and mini-bits from the olden days :))
  • Website

Recent Profile Visitors

6,886 profile views
  1. @@Bob Terveuren Hey just wanted to let you know I've started re-working your new standard_ipn.php code. I've also written your suggested update_store_stock($order_id) and send_order_emails($order_id) functions (to be put in functions/general.php I would assume). Let me know if this works for you so we're not both reinventing the wheel at the same time :) functions: *** Please note: I've used the original code from the stock OSC2.2rc2a checkout_process.php page. ***Also please forgive the tabulation in this code. The forum reply form keeps screwing with it :) function update_store_stock($order) { if (is_object($order) && tep_not_null($order->products)) { for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { // Stock Update - Joao Correia if (STOCK_LIMITED == 'true') { if (DOWNLOAD_ENABLED == 'true') { $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id=pa.products_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad ON pa.products_attributes_id=pad.products_attributes_id WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; // Will work with only one option for downloadable products // otherwise, we have to build the query dynamically with a loop $products_attributes = $order->products[$i]['attributes']; if (is_array($products_attributes)) { $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'"; } $stock_query = tep_db_query($stock_query_raw); } else { $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } if (tep_db_num_rows($stock_query) > 0) { $stock_values = tep_db_fetch_array($stock_query); // do not decrement quantities if products_attributes_filename exists if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } } } } return $order; } } function send_order_emails($order, $insert_id) { // lets start with the email confirmation $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; if ($order->info['comments']) { $email_order .= tep_db_output($order->info['comments']) . "\n\n"; } $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n"; for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } if ($order->content_type != 'virtual') { $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; } $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_order .= $order->info['payment_method'] . "\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } }
  2. I'm wondering why you would create the new table. Seems to me you could just add the new boolean field to the orders table. The customer email, order id etc can all be gleamed from the orders table when you check the boolean before running the decrement and outgoing emails, correct?
  3. Hi I too am now having problems using Paypal Website Payments Standard. My stock is not decremented nor is OSC sending me the order emails. I am receiving the PayPal IPN Verified (in the order history), however it seems it comes through as: "PayPal IPN Verified [Completed (Unverified; $17.85)]" for example. I'm assuming the "Unverified" part is because this was a non-Paypal account (ie credit card) order. It's a good thing Paypal send me the money received email, otherwise I wouldn't know if anybody ordered anything. Any solution on this? Is this problem unique to Paypal Website Payments Standard? Or are other payment modules having similar issues? Some items I found while researching a solution to this: Auto Return for Website Payments (Profile>My Selling Tools>Selling online(+/-)>Website preferences): This one is to set Auto Return for people who have a Paypal account. Customers without a Paypal account and pay with credit card are given the option to return to your site. from Paypal website: It looks like even though the return variable is set to checkout_confirmation.php in the paypal standard payment module, you need to set your Auto Return for Website Payments to ON and enter in in the Return URL field. The Return URL value is then overridden by the return variable that is sent for each individual transaction. - from the Paypal Website Payments Standard Integration Guide.pdf (under Using Your PayPal Account Profile>Tailoring the Checkout Experience>Setting Return URL on Individual Transactions) Regarding the IPN setting: I actually see that I have the Receive IPN setting turned to OFF, but I still receive transactions and the Paypal IPN Verified notices in my order histories so I don't know if setting this preference to ON is actually the correct solution. -from the Paypal Instant Payment Notification Guide (under Identifying Your IPN Listener to PayPal>Dynamically Setting the Notification URL): There is also the Payment Data Transfer (optional) [mine is set to OFF], but I'm not sure exactly how that option differs from the regular IPN notifications. Solution (?): It seems to me that the best way to address this problem (customers who paid with credit card not coming back to checkout_process.php) is to move the stock decrement and order email code into the Paypal IPN file (ext/modules/payment/paypal/standard_ipn.php) since this file is always called whenever a Paypal transaction (successful or not) has occurred. Right now, the stock decrement and order email code resides both in includes/modules/payment/paypal_standard.php [in before_process()] and also again on checkout_process.php -which I still don't understand why it's in both places; none of the other payment modules have this code duplicated, only the paypal standard module. If Paypal does not automatically redirect users back to your site (setting your Auto Return to ON will redirect Paypal users, but not credit card, non-Paypal transactions), checkout_process.php will never be called and thus, the stock will not be decremented nor the order email sent out (since these happen on that page). I've changed my Auto Return for Website Payments setting to ON (it is off by default) and I'll post again later if this was indeed a (partial solution) to this issue. This should handle my Paypal customers at least getting redirected back. The non-Paypal customers would need the above standard_ipn.php solution??? -Art
  4. :P Nice one... -see, this is why I should always read subsequent posts before going off and tinkering away to find the answer. You are 100% correct on that. array_sum($order->coupon->applied_discount) is the right answer That was a piece I needed to fix for the paypal_standard module. The original addon had hard-coded (includes/modules/payment/paypal_standard.php - app. line 313) $parameters['discount_amount_1'] =number_format($order->coupon->applied_discount['Unknown tax rate'],2); instead which would only ever apply a discount if your tax rate was set to 'Unknown tax rate'. Glad you found it. Those payment and shipping mods being included into the master module classes are pretty hard to find your way through. :D -Art
  5. Hi Mike Unfortunately, the Discount Coupon Codes contribution page has a whole lot of extras added and bugfixes so many of the downloads at the top are not "full" packages. The last "full packages" on that page are: Discount Coupon Codes 3.34 FR by delete13 (dated 26 Jul 2010) and SambaMambo (dated 19 Feb 2010) Discount Coupon Codes 3.34 (Español) by escri2 (dated 17 Nov 2009) Everything above these posts are extra features and bugfixes pertaining to specific payment gateways (ie Paypal Standard etc). The one I installed was the (Español) by escri2 and then the "PayPal Website Payments Standard Discount + show the orders details" by sunrise9 (dated 30 Apr 2013) since I use PayPal Website Payments Standard for my site. If you use the same, make sure to download my addition "PayPal Website Payments Standard Discount + show the orders details - Fixed" (amseek - dated 21 May 2013) which is a bugfix for the one submitted by sunrise9. I have everything working great with these installed. As an added note, the two "V3.34 - Admin login page error" posts by dontlike2pay do not apply to the (Español) version I downloaded. The "MeFindCoupon" thing is completely not applicable either (it's a Windows shortcut link to the guy's home setup). Not sure why it was posted, but hey, it's a contribution nonetheless. It's the thought that counts :) Okay, I hope this maybe clears things up a bit and helps you out :thumbsup: -Art
  6. Hi greasemonkey, Not sure if this would help or not, but I have a similar situation (where I am giving a discount to certain customers only). My thinking is when I create a new discount, it generates a unique discount code. I set the normal discount parameters, but then give the generated discount code to one customer only. For my purposes, I also set the Max Use to 1 and Available to 1. This way only that one customer can use the coupon one time only. The could give away their unique coupon code, but they could never use more than one time. For multiple customers (like your 200), I'm planning on creating a script to automatically generate multiple coupons with unique coupon codes. Then I can simply hand out a seperate coupon code to each customer. Hope this helps :) -Art
  7. Just added a fix for the "PayPal Website Payments Standard Discount + show the orders details update" if anyone's interested (contib page:,22).
  8. Hi I'm not fully sure this is the correct fix for my setup, but I was having a rounding issue when using Paypal Standard. Personally I don't mind if the order total is off by 0.01 even if I loose that 1 cent. But I just couldn't be okay with my order totals saying one thing and then once I sent the data over to Paypal, the total price would be different. Turned out the problem for my setup (Display subtotal with applied discount and Display discount with discounted tax applied) was that the shown subtotal on my confirmation page was where things were off. The calculated subtotal (and discount, taxt, total etc) were fine. It was just the rounded amount shown to the customer for the subtotal was off by one cent. The fix for me was to perform the rounding as the subtotal is being aggregated in $order->cart() in the $products loop. I noticed that the default OSC code was performing the roundon each product's total in that loop, so why not the discount code? Hope this helps somebody. in includes/classes/order.php in the kgt - discount coupons edit in cart() (app. line 320) change: $this->info['subtotal'] += $shown_price['shown_price']; to: $this->info['subtotal'] += round($shown_price['shown_price'], 2); so that the kgt - discount coupon edit now looks like this: //kgt - discount coupons if( is_object( $this->coupon ) ) { $applied_discount = 0; $discount = $this->coupon->calculate_discount( $this->products[$index], $valid_products_count ); if( $discount['applied_discount'] > 0 ) $valid_products_count++; $shown_price = $this->coupon->calculate_shown_price( $discount, $this->products[$index] ); $this->info['subtotal'] += round($shown_price['shown_price'], 2); $shown_price = $shown_price['actual_shown_price']; } else { $shown_price = $currencies->calculate_price($this->products[$index]['final_price'], $this->products[$index]['tax'], $this->products[$index]['qty']); $this->info['subtotal'] += $shown_price; } //end kgt - discount coupons
  9. I know this is an old post here, but figured I'd add this just for any of those like myself who stumbled here while looking into this same idea. I did write a quotation module that isn't exactly what the OP asked for but it's a quote contribution at least. I have been planning on implementing the multiple items/cart contents into it for future releases, but for the present moment, it only can handle doing quotes for one product at a time. Basically, it provides a mailto: link wherever a product's price would normally be. It also disables all checkout ability if you have it set that all your products are for quotes only. There's more to it than just that like when the customer's email program start a new compose message, that message is pre-populated with product info, link back to the product page and other things. This email is going to yourself of course so all the extra info in there is to make things easier for you to perform the quote. There's other features as well and it's controlled in the admin. See description on the contrib page: OSCv2.2rca: OSCv2.3.1: hope this might help somebody :) -Art
  10. I can see one thing right off the bat if you're into it. I was currently in at the point of creating a batch import of multiple contributions at once. Would be simple one entry per line set up (comma separated values per field or similar). Wouldn't be too hard to adjust to your formatting I'm sure. Interested? -Art
  11. See, this is one of those times where I shoulda ran a good search in the OSC Contributions before building my newest coolest addon! :)=) You beat me to the punch :) Just installed this one and I might say, "great minds think alike". -or maybe the functionality et al was just the most logical way to get the tasks done. Although, the cronjob setup is a nice touch. Kudohs! I'll play around a bit and give some feedback etc in a bit. Maybe contribute any items/procedures that I may have done for mine that is not present in yours (if it's a worthwhile update of course)? I'll let you know what I find out. Thanks for the time and effort :)) Oh, super slick too btw :)) -Art (amseek)
  12. Is your php.ini setting set to: display_errors = Off ? This will give you a blank white screen. Php has generated the error message like normal, but with the setting set to 'Off', the normal output to your screen has been suppressed. That would be my first assumption If you can change your php.ini settings (directly in the file itself or through some other hosting account control panel, shange this setting to 'On' and refresh your page. If you can't change this setting, what I usually do if very first line of that php page, I do a simple echo, like as in echo "ff"; Refresh the page and if 'ff' shows at the top, I just Cut/Paste the echo "ff"; code further and further down the page and hit refresh after every move. Soon as a refresh doesn't show me the 'ff', I know the php error is being generated somewhere between the echo "ff" current location and the last location that showed a 'ff'. What the actual error msg is about, you won't be able to figure out from your page itself. You can review your php error message log provided you have log_errors = Off (another php.ini setting which might not be of any help at all if you can't edit these settings). I do know you can set some php.ini settings at run-time using ini_set(). Format: string ini_set ( string $varname , string $newvalue ) There are many many times I couldn't get this approach to work though. Past that, I don't know :\
  13. Hi I have already install v1.3.5 and am currently working on upgrading to 1.3.9. The problem I'm having right now is all of the extra files provided in the release catalog/ folder such as catalog/admin/includes/functions/general.php or catalog/admin/categories.php. I'm wondering why these files are included in the release? It's driving me crazy because these files aren't referenced in the install or readme files. Is there a reason these files are included? Thank you -Art
  14. UPDATE: I've re-released Member Approval v1.5_4 Full package with all updates and bug fixes included. The re-release is for Fresh Installs only
  15. UPDATE: There is now another (small) bug fix added to the Member Approval contribution page: "Bugfix2 (mini) for Member Approval v1.5_2 - v1.5_4". (My link This is a separate mini fix that I found after submitting the original. You will want to run this fix as well. Thanks -Art