Tips and Tricks WP eCommerce

eCommerce Solution for WordPress Blog

  • Home
  • eCommerce Plugins
  • WP eStore Documentation
  • WP Shopping Cart Doc

Adding an ID to the Add to Cart Button of the Plugin

You can add an ID tag to the add to cart button form using the following filter hook of the plugin.

wspsc_add_cart_button_form_attr

Below is an example PHP code that shows you how it works:

add_filter('wspsc_add_cart_button_form_attr', 'add_cart_button_custom_id');
function add_cart_button_custom_id($attr)
{
    $attr .= 'id="my_custom_id_123"';
    return $attr;
}

The above example code will add the ID of “my_custom_id_123” to the add to cart button form.

Filed Under: WordPress Shopping Cart Tagged With: Tweaks

Customize the Shopping Cart Image/Icon in the Cart

The simple shopping cart plugin has a filter that you can use to customize the Shopping Cart image icon that is displayed at the top of the cart.

Code Example

The following code example shows how you can use your own custom cart image.

Upload your custom cart image via the media library so you have the URL of the cart image ready.

Add the following code block to your theme’s functions.php file and specify the actual custom cart image URL:

add_filter('wspsc_cart_icon_image_src', 'override_cart_image_icon');
function override_cart_image_icon($cart_img_src)
{
    //Specify the URL of your custom cart image
    $cart_img_src = 'http://www.example.com/uploads/my-custom-cart-image-icon.jpg';
    return $cart_img_src;
}

Filed Under: Additional Guidance, WordPress Shopping Cart Tagged With: cart shortcode, code example, Tweaks, WP Shopping Cart

Customize the PayPal Checkout Button Image in the Shopping Cart

The simple shopping cart plugin has a filter that you can use to customize the PayPal checkout button image of the cart and use your own custom image for the button.

Code Example

The following code example shows how you can use your own custom PayPal checkout button image.

Upload your custom checkout button image via the media library so you have the URL of the custom image ready.

Add the following code to your theme’s functions.php file and specify the actual custom image URL of the checkout button that you want to use.

add_filter('wspsc_cart_checkout_button_image_src', 'override_checkout_button_image');
function override_checkout_button_image($checkout_button_img_src)
{
    //Specify the URL of your custom image
    $checkout_button_img_src = 'http://www.example.com/uploads/my-custom-checkout-image.jpg';
    return $checkout_button_img_src;
}

Filed Under: WordPress Shopping Cart Tagged With: Button Images, paypal, Tweaks, WP Shopping Cart

Simple Shopping Cart – Adding Extra PayPal Input Fields

The simple shopping cart plugin has a filter that you can use to add extra input fields that will get sent to PayPal as part of the checkout.

Code Example

The following code example shows how you can append extra fields to the checkout form (add this code to your theme’s functions.php file or a custom plugin).

It will add the language code field to force a specific language on the PayPal checkout page.

add_filter('wspsc_cart_extra_paypal_fields', 'append_extra_fields');
function append_extra_fields($output)
{
    //Add the PayPal language code field
    $output = '<input name="lc" type="hidden" value="US" />';
    return $output;
}

Filed Under: WordPress Shopping Cart Tagged With: Integration, paypal, paypal api, Tweaks, WP Shopping Cart

Simple Shopping Cart – Adding Values to PayPal Custom Field

The simple shopping cart plugin has a filter that you can use to add extra data to the PayPal custom field.

Note: The plugin already uses the PayPal custom field to pass some parameters to PayPal. So you should append your data to this custom field (to make sure you don’t erase the custom data added by this plugin)

Code Example

The following code example shows how you can append data to the custom field (add this code to your theme’s functions.php file or a custom plugin).

add_filter('wpspc_cart_custom_field_value', 'append_my_custom_data');
function append_my_custom_data($custom_value)
{
    //Append my data using query parameter
    $custom_value = $custom_value . '&my_data=XYZ';
    return $custom_value;
}

This will pass your data along with the cart’s custom data to the PayPal’s custom field.

Filed Under: Additional Guidance, WordPress Shopping Cart Tagged With: paypal, paypal advanced, paypal api, Tweaks, WP Shopping Cart

Example Code for Custom Autoresponder Integration with WP eStore

This documentation is only for developers. If you are not a developer then you have no need to read this.

First read this post to understand some basics.

The following is an example code that shows you how use the item specific signup hook (this hook is called for each item that the customer purchases):

add_action('eStore_item_specific_autoresponder_signup', 'my_estore_custom_signup');
function my_estore_custom_signup($signup_data)
{
    eStore_payment_debug('Received request for item specific autoresponder signup action.', true);
    $firstname = $signup_data['firstname'];
    $lastname = $signup_data['lastname'];
    $email = $signup_data['email'];
    $list_name = $signup_data['list_name'];
    //TODO - write your autoresponder signup code here.
}

The value you specify in the “List Name” field (under the autoresponder settings section of the product) will be passed in the above function using the “list_name” parameter.

 

Filed Under: Additional Resources Tagged With: Autoresponder, code example, Tweaks

Running Additional Tasks After a Sale via the Simple Cart Plugin

You can run some additional tasks after the simple cart plugin has processed a sale.

Note that this should only be tried by a developer as it involves custom PHP coding.

The plugin has an action hook that gets fired after the PayPal IPN (Instant Payment Notification) data is processed. You can use this hook to do additional custom tasks. Below is an example snippet of code that shows you how to use this action hook.

Add the following block of code to your functions.php file of the theme:

add_action('wpspc_paypal_ipn_processed', 'wspsc_my_custom_ipn_tasks');
function wspsc_my_custom_ipn_tasks($ipn_data)
{
    //You can write the $ipn_data array's content to a file to see
    //what paypal sends in the IPN
    $firstname = $ipn_data['first_name'];
    $lastname = $ipn_data['last_name'];
    $email = $ipn_data['payer_email']
    //Do something with the data

}

The IPN message consists of variables and is available as an array inside your function. You can access an element of the array by using the proper variable name. To see a list of all the available variables please check the PayPal IPN documentation page.

Filed Under: WordPress Shopping Cart Tagged With: code example, e-commerce, Tweaks, WP Shopping Cart

Simple Shopping Cart – Customize the Thumbnail Section of the Product Box

You can customize the thumbnail image section of the product box display to suite the way you want to show it.

Below is an example of how the thumbnail section of the product display box looks like:

product display box example

Now, lets say you are using a lightbox plugin and you wanted to add lightbox to the thumbnail image. Below is an example snippet of code to show you how you can customize the thumbnail image section to accommodate that:

add_filter('wspsc_product_box_thumbnail_code', 'wspsc_my_custom_thumbnail_code', 10, 2);
function wspsc_my_custom_thumbnail_code($img_code, $args)
{
    $thumbnail_src = $args['thumbnail'];
    $img_code = '<a href="'.$thumbnail_src.'" rel="lightbox"><img src="'.$thumbnail_src.'" alt="'.$args['name'].'" ></a>';
    return $img_code;
}

Filed Under: WordPress Shopping Cart Tagged With: Tweaks, WP Shopping Cart

Simple Shopping Cart – Resize/Customize the Shopping Cart Width

The simple shopping cart is responsive, so it will automatically fit into the container you put it in. However, if you want to re-size the width of the cart shortcode output then use the following CSS tweak:

Step 1) Grab this custom CSS plugin

Step 2) Add the following CSS code in that plugin.

The following make the width of the shopping cart 70% of the parent container:

.shopping_cart{
width: 70% !important;
}

Alternatively, you could use a pixel value like the following:

.shopping_cart{
width: 300px !important;
}

Filed Under: WordPress Shopping Cart Tagged With: cart shortcode, compact cart, Tweaks, WP Shopping Cart

Customizing Price Amount Display Currency Formatting

You can customize the price amount display formatting to suite the way prices are displayed in your country and currency.

Here are some examples:

By default the price amount is display like the following:

$25.00

In your country and currency, you may want to show the currency symbol at the end of the amount. Below is an example of how you can customize the price display amount.

Simply add the following block of code to your functions.php file of the theme:

add_filter('wspsc_print_formatted_price', 'wspsc_my_custom_price_format', 10, 3);
function wspsc_my_custom_price_format($formatted_price, $price, $symbol)
{
    $formatted_price = number_format($price, 2, '.', ',') . ' '. $symbol;
    return $formatted_price;
}

It will now show the price amount like the following

25.00 zł

You could also change the decimal separator to be “,” and the thousand separator to be “.” in the price output. Here is an example of how to do that (add the following code to your functions.php file of the theme):

add_filter('wspsc_print_formatted_price', 'wspsc_my_custom_price_format', 10, 3);
function wspsc_my_custom_price_format($formatted_price, $price, $symbol)
{
    $formatted_price = $symbol . number_format($price, 2, ',', '.');
    return $formatted_price;
}

It will now show the price amount like the following

₤25,00

Filed Under: WordPress Shopping Cart Tagged With: Tweaks, WP Shopping Cart

  • 1
  • 2
  • Next Page »

Your Shopping Cart

Shopping Cart Empty
Shopping Cart is Empty
Visit The Shop

Search

Featured Documents

Stylish Product Display Options for WP eStore WP eStore Quick Setup and Usage Video Tutorial WP eStore Shortcodes and Functions Reference WordPress eStore Plugin Features WordPress eStore Plugin Demo What Our Customers Have to Say About Our Products WordPress eStore WishList (Feature Suggestions) WordPress eStore Frequently Asked Questions (FAQ) How to Show Add to Cart buttons

Featured Plugins

wordpress_estore_icon
wordpress membership plugin icon
WP Express Checkout Plugin
Lightbox Ultimate Plugin
wordpress_affiliate_plugin_icon

Copyright © 2023 | eCommerce Plugins