Category Archives: WordPress shopping cart

WordPress shopping cart

WP e-Commerce – Can’t Insert Image into Product Content [FIX]

WordPress version: 3.1
WordPress theme: Twenty Ten 1.2
WP e-Commerce version: 3.8

Problem:

The “Insert into Post” button is missing when trying to insert a product image into a WP e-Commerce Product Page

Solution:

File: root/wp-content/plugins/wp-e-commerce/wpsc-admin/includes/display-items-functions.php

Line 1102:

Change

td.savesend input.button {
display: none;
}

To

td.savesend input.button {
display: block;
}

WARNING: I have no idea what type of consequence this edit will have on your WordPress installation or if it will conflict with your theme.

Custom WordPress Case Study: Child Theme Edits – Plato’s Survey

Custom WordPress - Plato's SurveyVisit Plato’s Survey.

Overview: Custom WordPress site with shopping cart to sell marketing materials and Web-based surveys. Visitors will fill out survey forms, while franchise owners can order business cards, loyalty cards and customer survey campaigns.

Process: Utilized & customized the WordPress Thematic Feature Site child theme for Thematic. Integrated shopping cart, slide show, image gallery, advertising and surveys:

  • Integrated WP e-Commerce shopping cart
  • Customized shopping cart to include Image Gallery, as well as item & quantity variations
  • Customized Home page PHP code to accommodate SlideDeck slide show
  • Added logo to background
  • Integrated customer surveys
  • Integrated Google AdSense ads
  • Custom templates for sidebar and non-sidebar page layout
  • Custom WordPress pages
  • Set up contact form

WordPress plugins used:

  • Advertising Manager
  • cforms (contact form)
  • Display widgets
  • Insere Iframe
  • NextGEN Gallery
  • NextGEN Galleryview
  • Per Page Sidebars
  • SlideDeck
  • WP-DBManager
  • WP e-Commerce
  • WP Security Scan

Software used:

  • WordPress for framework
  • Illustrator for custom graphics
  • Dreamweaver for editing PHP
  • Dashcode for custom CSS

WP e-Commerce: FIX for PayPal/Credit Card Purchase Sending Incorrect "Order Pending: Payment Required" Emails

WP e-Commerce v3.7.6.9 (the latest stable version available, downloaded Sept 18, 2010)
WordPress v3.0.1
Testing done in PayPal Sandbox & on live site (once Sandbox testing proved successful)
Themes tested: 1) WP Twenty Ten 1.1; 2) Thematic 0.9.6.2; 3) Thematic Feature Site 1.0.1 child theme

Problems: after making a PayPal or credit card purchase I get the wrong messages/emails notifications:

  • Incorrect Transaction Results page: shows “Order Pending: Payment Required” message after making a purchase with PayPal or credit card. The Transaction Results page should show “The Transaction was successful” text.
  • Incorrect email notification: After a PayPal or credit card purchase, the customer should receive a “Purchase Receipt” email confirmation. But instead, they incorrectly receive an “Order Pending: Payment Required” email.
  • Incorrect Sales status: shows “Order Received” in WP e-Commerce’s back-end. The Sales status should read “Accepted Payment,” because the customer paid with PayPal or a credit card.

WP e-Commerce settings: Store > Settings > Payment Options:

  • Payment Gateway: Paypal Payments Standard
  • IPN: Yes
  • Send shipping details: Off
  • Shipping override: Off

PayPal settings: Nothing changed; I kept all of the default settings: IPN is off, no return page.

Solution 1 of 3: Go to wp-e-commerce/merchants/paypal_multiple.php

Find the following lines:

  • Line 241: if(get_option('paypal_ipn') == 0) { // A setting of 0 ensures that digital downloads still work for people without IPN, but it's less secure.
  • Line 242: //$wpdb->query("UPDATE `".WPSC_TABLE_PURCHASE_LOGS."` SET `processed` = '2' WHERE `sessionid` = ".$sessionid." LIMIT 1");

Change to:

  • Line 241: if(get_option('paypal_ipn') == 1) { // Setting to 1 allows the Successful Transaction to be displayed on the Transaction Results page. A setting of 0 ensures that digital downloads still work for people without IPN, but it's less secure.
  • Line 242: $wpdb->query("UPDATE `".WPSC_TABLE_PURCHASE_LOGS."` SET `processed` = '2' WHERE `sessionid` = ".$sessionid." LIMIT 1");

What I did:

  • Changed get_option value from 0 to 1 at line 241
  • Deleted // at the beginning of line 242

Solution 2 of 3 (this step may no longer be necessary. Make a test PayPal Sandbox purchase with just Solution #1 above before making this 2nd Solution edit.): Go to wp-e-commerce/function_results.php

Find the following line:

Line 40: }elseif($sessionid == ''){

Change to:

Line 40: }if($sessionid == ''){

What I did:

  • Deleted “else” from the elseif statement

Solution 3 of 3 (this step may no longer be necessary. Make a test PayPal Sandbox purchase with just Solutions #1 & #2 above before making this 3rd Solution edit.): Go to wp-e-commerce/wpsc-admin/ajax-and-init.php

Find the following line:

Line 1337: transaction_results($log_data['sessionid'],false);

Change to:

Line 1337: transaction_results($log_data['sessionid'],true);

What I did:

  • Changed “false” to “true”

NOTE: These changes may affect digital purchases/downloads from working properly. Your setup may be different from mine.

TEST RESULTS (using PayPal Sandbox & live site):

PayPal payment results – GOOD:

  • Transaction Results page: The Transaction was successful – GOOD
  • Customer receives correct “Purchase Receipt” email notification – GOOD
  • Sales section in WP e-Commerce shows correctly as “Accepted Payment” – GOOD

Credit Card payment results – GOOD:

  • Transaction Results page: The Transaction was successful – GOOD
  • Customer receives correct “Purchase Receipt” email notification – GOOD
  • Sales section in WP e-Commerce shows correctly as “Accepted Payment” – GOOD

Manual payment results – GOOD:

  • Transaction Results page: Purchase is pending – GOOD
  • Customer receives correct “Order Pending” email notification – GOOD
  • Sales section in WP e-Commerce shows correctly as “Order Received” – GOOD

@getshopped WP e-Commerce *live* shopping cart testing going great! Manual & CC purchases working beautifully

Had to make a minor adjustment to the paypal_multiple.php file in the merchants folder. When making a PayPal or Credit Card purchase I was receiving an “Order Pending” message on the Transaction Results page, as well as in the customer’s email notification. This problem seems to be solved. More info to follow if all checks out.

Here’s what I did to get things working with the WP e-Commerce/GetShopped plugin. Note: this info may be outdated by the time you read this.

*Live* shopping cart testing is working great so far for both Credit Card and manual purchases:) I haven’t tested any digital downloads yet.

WP e-Commerce – Staying Current; Upgrading To Newest Version

Instructions cover the following version upgrades:

  • When upgrading to 3.7.5.3
  • When upgrading “within” 3.7 itself (for example 3.7.5 to 3.7.5.3)
    • Specifically: If your wp e-commerce theme is still located at wp-content/plugins/wp-e-commerce/themes/ you should move it to wp-content/uploads/wpsc/themes/ in order to preserve your changes
  • When upgrading to 3.7 from any older 3.6 version

Read full instructions: http://getshopped.org/resources/docs/upgrades/staying-current/

WP e-Commerce – Duplicate Products Problem Fixed

Problem: Duplicate products were being displayed when using the [productspage] shortcode on a Page.

Solution*: Remove any duplicate product_id rows in the wp_wpsc_product_order table in phpMyAdmin.

*This solution worked in my case. It may not work in every situation.

Running:
WordPress 3.0.1
WP e-Commerce 3.7.6.7

WP e-Commerce Fix for Broken Product Links

Broken product links? Product link goes to a blank page.

Problem: Shopping cart page shows up fine, and products are purchasable. But if I click on the Product’s link to go to that individual product’s page, the link just goes to a blank page.

Solution: Click the “Fix Product Group Permalinks’ link in WP e-Commerce’s back-end: Settings > Admin (scroll to bottom of page).

Running:
WordPress 3.0.1
WP e-Commerce 3.7.6.7

WP e-Commerce – Can't Edit or Delete Products

Original post: http://getshopped.org/forums/topic.php?id=10542#post-40321

Just to flesh out @reikob’s solution, turn off settings>presentation on “drag and drop” and reset it to sort products by time uploaded. The ability to edit products returns.

With the selection to sort products by time uploaded, the drag and drop sort capability for both editing and displaying products remains in force. Be sure not to reorder products in the ‘view all categories’ mode – this will only apply to the unusable ‘category = 0’, which is actually nonexistent. Rather, select the category filter in which you wish the reorder to take place, and the drag and drop will work flawlessly.

Thanks @reikob!
Also, if you want to clean up the table which has in it all your previous (incorrect) attempts at ordering products, go to your phpMyAdmin. Select the wp_wpsc_product_order table, and delete all rows which have a category_id = 0.

Update from Designparc: I have found that the above fix causes duplicate products in some cases (when using the [productspage] shortcode). This is solved by removing any duplicate product_id rows in the wp_wpsc_product_order table in phpMyAdmin.

Running:
WordPress 3.0.1
WP e-Commerce 3.7.6.7

WP e-Commerce Tip: Re-ordering Shopping Cart Products

Problem: I now have 4 products in my WP e-Commerce shopping cart and want to move the 4th product to the first position.

Solution: On the WP e-Commerce admin page (labeled “Store” in WordPress’s admin), click on the Products tab. You’ll now be on the Display Products screen. Use the drop-down box to select the Category that contains the products you want to re-order. Hover over the product’s thumbnail to drag-and-drop* it to a new position.

Now, go to Store > Settings > Presentation (scroll down to the Product Page Settings section) and choose “Drag & Drop” in the drop-down menu, then click Update at the bottom of the page.

*If you have used the drag-and-drop interface on the edit-products page to re-order your products then you must select the Drag & Drop option on the Presentation page. Although I’m not sure, this may mean that you’ll never be able to sort products by “name,” “price,” or “time loaded.”

Installation:
WordPress 3.0.1
WP e-Commerce 3.7.6.7

WordPress Tutorial: WP e-Commerce v3.7.6.7: Change “P&P” to “S&H” for Shipping & Handling

WP e-Commerce changed where the files to change P&P to S&H are located. The following instructions assume that you have upgraded to this version of WP e-Commerce (v3.7.6.7) and have followed the instructions for upgrading and moving theme folders.

*WARNING: Do NOT copy and paste the below code into your files. Please make the recommended changes in your own files, by hand!

There are 2 files to alter.

File #1: wp-content/uploads/wpsc/themes/default/products_page.php
Line: 218

CHANGE: <span><?php echo wpsc_product_postage_and_packaging(get_option(‘wpsc_hide_decimals’)); ?></span><?php echo __(‘P&amp;P‘, ‘wpsc’); ?>:  <br />

TO: <span><?php echo wpsc_product_postage_and_packaging(get_option(‘wpsc_hide_decimals’)); ?></span><?php echo __(‘S&amp;H‘, ‘wpsc’); ?>:  <br />

File #2: wp-content/uploads/wpsc/themes/default/single_product.php
Line: 157

CHANGE: <span><?php echo wpsc_product_postage_and_packaging(); ?></span><?php echo __(‘P&amp;P‘, ‘wpsc’); ?>:  <br />

TO: <span><?php echo wpsc_product_postage_and_packaging(); ?></span><?php echo __(‘S&amp;H‘, ‘wpsc’); ?>:  <br />