MageParts

Skip to Main Content »

User Guides

My Cart

You have no items in your shopping cart.

Community Poll

What do you think of our support service?
 
 
 
 

Newsletter

Newsletter
 

Quantity Options & Fixed Prices   -   User Guide

Chapter 1: The Basics

This chapter will cover the basic functionality of the extension.

1.1The Configuration Section

The configuration is accessible from the top menu, System → Configuration under the tab MageParts → Quantity Options & Fixed Prices.

Config overview
  1. Navigate to System → Configuration in the top menu.
  2. Click on the Quantity Options & Fixed Prices tab in the MageParts section of the left-hand menu.

1.2Enabling / Disabling the Extension

General Settings - Enabled Setting

The easiest approach is by simply changing the value of the Enabled setting, available under General Settings box in the extensions configuration section (please see chapter 1.1 for information on how to reach the configuration section).

Disabling the extension from here will still let Magento load it and make use of its resources, but it won't render any of its content.

You can toggle the output of the extension, as well as the output of any other module included in Magento, by navigating to System → Configuration and clicking on the tab System → Advanced. Disabling the extension here will still allow Magento to load it and make use of its resources, but it will prevent the extension from rendering any content. As the setting title implies you effectively disable any content coming from the extension form being rendered.

To completely disable the extension (meaning that Magento won't be able to load it at all) you can rename the file app/etc/modules/MageParts_Ddq.xml to app/etc/modules/MageParts_Ddq.xml- and refresh the cache from System → Cache Management. It should be noted that this approach isn't recommended and can cause issues since some attributes installed by the extension relies on models included in the extension package, which won't be loaded if you disable the extension this way. For information regarding how to remove these attributes please view chapter 11.

1.3Quantity Options

A quantity option consists of four (4) settings.

Quantity Option Table
Setting Value Required
Quantity Desired quantity. Yes
Price Lave empty for native price calculations to apply. No
Label If left empty the label template (see chapter 4 for more information) or quantity value will be used instead. No
Order Sorting order. No

Click on the Add Option button at the bottom of the table to add a new option row.

Add Quantity Option Button

Quantities entered in the extension's configuration section will be the default values applied to all of your product records. You can of course disable the extension for individual product records, as well as setup custom quantity options for specific product records.

Using the Preselected Quantity setting you can decide which quantity option should be selected by default. Enter the quantity value of the option you wish to be automatically selected by default. If no value is assigned to this setting the first available option will be used instead.

Preselected Quantity Setting

You can hide quantity options which aren't available to a product by enabling the Hide Unavailable Quantities feature. The extension checks the quantity list against the stock of a product to determine which options aren't available and removes them before rendering the quantity option list element.

Hide Unavailable Quantities Setting

Using the No Options Action you can decide what will happen in case none of the configured quantity options are available for a given product.

No Options Action Setting
Action Description
Display Current Product Quantity as a Single Quantity Option Example: if the lowest configured quantity option for a product is "5", and there is only "2" left in stock, an option for the quantity "2" will be added to the quantity options list for the product while all remaining options are removed.
Display Normal Quantity Text Box Means that the extension will become disabled for the product.
Set Product as Out of Stock It should be noted the product will still appear in category listings and catalog search results.

1.4Showing Prices On the Fly While Selecting Quantity

This is a feature which will allow your clients to view the final price of a product based on the selected quantity before it's added to the cart.

It works perfectly with all product types, tier prices, group prices, custom options, special prices etc.

Price calculations are applied on the product lists, product view and the shopping cart. It also takes into account prices excl. and incl. tax to properly reflect your tax configuration.

If the Display Prices Based On Quantity setting is enabled prices on the frontend will be calculated when the selected quantity for a product is changed.

Display Prices Based On Quantity Setting

1.5Debugging

To debug the extension, please first enable the Enable Debug Log setting.

Enable Debug Log

After this setting has been enabled useful data will be logged in the file var/log/ddq.log.

The data logged to that file could help you quickly locate and resolve potential issues isolated to your specific Magento installation (such as interference form other extension or custom modifications).

You can also of course submit the log file along with a description of your problem to us at info@mageparts.com and our support staff will quickly help you handle your problem.

Chapter 2: Product Specific Settings

This chapter covers the use of product specific settings and how some settings will affect products differently depending on their type.

Start by opening a simple, virtual or downloadable product in the administration panel and click on the Inventory tab in the left-hand menu.

At the bottom of the page you will see there is a box labeled Quantity Options. The values will by default reflect those in the system configuration.

Product In Admin Panel

To change the value of a specific setting first click on the Use Config Settings checkbox beneath the setting so it will be un-marked.

Product In Admin Panel, Use Config Settings Checkbox

You can now proceed to edit the value of the setting as you would any other setting for the product.

The quantity option settings are setup just as normal Magento attributes, which means that you can view and modify them from Catalog → Attributes → Manage Attributes.

You can of course also decide which attribute sets should include the attributes from Catalog → Attributes → Manage Attribute Sets.

2.1Hierarchical Setting Fallback System

Please note that in this example the parent product refers to a configurable product, and the child product is a simple product associated with the parent product. The same type of behaviour is applied or all product types that have a parent / child relationship, the exception being bundle products.

To put it in the simplest of terms, child products are defaulted to their parent product (if there is any), and then to the system configuration (Simple Product → Configurable Product → System Configuration).

It should be noted that a product is only defaulted to it's parent if it can be, and this is depending on the location where you are viewing the product.

While editing a product in the administration panel settings are always defaulted to the system configuration. This is because a simple product can have several parents, and thus it cannot be safely defaulted to the parent in the administration panel.

If you are viewing the configurable product on the frontend, it's children will be defaulted to it.

If you are viewing a simple product individually on the frontend which is associated with one or more configurable products it will be defaulted directly to the system configuration.

It's very important to understand that child products will only default to their parent product if the parent product is the product you are viewing on the frontend.

2.2Bundle Products

You can configure quantity options for a bundle product but not for the individual product options (the simple products included in the bundle).

Also, since the bundle product doesn't have its own stock some features of the this extension may not be available to the bundle product (for example the features incremental options and hide unavailable quantity options.)

Chapter 3: Incremental Quantity Options

This feature automatically generates quantity options for your products. To activate the feature you will first need to enable it. The feature can be enabled / disabled for individual products as well.

Enabling Incremental Feature

If you have the need to set fixed prices, or specific labels, for the generated quantity options you will also need to enable the setting Save Values to Product.

Enabling Incremental Feature, Save to Product

Be careful when using this setting, when enabled the generated quantity options are saved directly to the product. This means that if you've already setup some product specific quantity options for some of your products the values could be over written, and if you ever need to remove the auto genrated values you will need to go through your products and restore the values on each of them which can be a tedious task.

To summarize, this setting should never be enabled unless you need to assign specific prices and / or labels to your generated quantity options.

3.1Generating Field

You need to assign a field which the generating process will be based on. The value of that field will be used when generating the quantity options.

Incremental Quantity Generating Field
Option Description
Use Quantity Increments Value Uses the value of the native inventory setting Qty Increments.
Custom Value A text box will appear where you can assign a value that should be used.

For example, if you have selected to use the native Qty Increments setting as your generating field, and it's been assigned the value "5" for one of your products, the options generated would be "5", "10", "15", "20", "25" and so on.

3.2Option Limit

This setting allows you to limit the number of options which will be generated.

Incremental Quantity Option Limit
Option Description
As Many as Possible (Based on Stock Quantity) Generates as many options as it possible for the in stock quantity of a product.
Custom Limit A text box will appear where you can assign a value that should be used.

Chapter 4: Layout Options

There are different types of layouts which can be used for the quantity option elements displayed on the frontend for your products. Remember that you can set a different layout from that in the configuration for individual products.

Layout Type Config Option
Option Description
Drop-Down List (Select Box) A normal select box element.
Table With Radio Buttons A table which lists each quantity option along with other data of your choosing (please see a bit further down in the manual for the part about configuring this layout alternative).

4.1Layout Type: Drop-Down List (Select Box)

When selecting the layout alternative Drop-Down List (Select Box) a new setting will appear which will allow you to include a header option for the select box. If you activate this option another setting will appear where you can enter the text for said header option. The header option could for example be "Please select" or similar. This is optional to include of course.

Layout Type Select Additional Options

4.2Layout Type: Table With Radio Buttons

When selecting the layout alternative Table With Radio Buttons a new setting will appear, Use Table Layout For. This setting will allow you to select which product types the table layout option should be used for. All product types which are left unselected will use the system default, Drop-Down List (Select Box).

Layout Type Table Additional Options

The Table Columns setting lets you specify which columns should be included in the element. This setting is only important if you've chosen to use the Table With Radio Buttons layout alternative here in the system configuration, or for any of your products.

Table Columns Setting
Setting Value Required
Type The column data type. Please note that Radio Button should always be included as one of your columns since that's what the client will use to select the quantity option. Yes
Title The column title (header element text). No
Order Column sorting order. No

4.3Label Templates

You can use keywords in your labels that will be replaced by data from the quantity option. Keywords are enclosed in double bracers ({{keyword}}).

Below is a table displaying all available label keywords as well as a few examples to better illustrate their usage.

Table Columns Setting
Keyword Replacing Value
qty Quantity.
stock_status Product stock status.
price Product price.
price_old Old product price, for example if a special price is applied on the product.
price_excl_tax Product price excl. tax.
price_incl_tax Product price incl. tax.
unit_price Unit price.
unit_price_old Old product unit price, for example if a special price is applied on the product.
unit_price_excl_tax Unit price excl. tax.
unit_price_incl_tax Unit price incl. tax.

Examples

Please note that the examples below assumes a product price of $125 and a product which is in stock to easier explain and illustrate how the labels function.

The example label below, {{qty}} for {{price}}, translates to 1 for $10.00.

Quantity Option Label Example 1

The example label below, {{qty}} for {{price}}, {{unit_price}} ea. translates to 5 for $50.00, $10.00 ea..

Quantity Option Label Example 2

The example label below, {{qty}}, {{stock_status}} translates to 10, in stock.

Quantity Option Label Example 3

The example label below, {{qty}} for {{price}} translates to 25 for $3125.00 (if the product has a price of $125).

Quantity Option Label Example 3

You can use the setting Default Label Template to setup a default label that will be used for all quantity options which doesn't have a specific label assigned to them.

For example, if you wish for all of your quantity options to have the label {{qty}} for {{price}}, you simply enter that pattern in the settings input box.

Quantity Option Default Label Template

4.4Label Prefix and Suffix

There are two settings available to set a label prefix and suffix, phrases which will always be included at the beginning and end of every label.

These settings can also include keywords as explained in the previous chapter.

Quantity Option Label Affix

Chapter 5: Product List Integration

Some themes include quantity boxes in product lists, for example on category pages or product search result pages. The extension comes prepared for that scenario but may require you to apply a few template modifications in order to function correctly.

The quantity text box elements will need an ID that our extension can use as a reference when displaying the quantity option elements.

The ID should look like this: qty-box-[product_id] where [product_id] is replaced by the id of the product connected to the quantity box.

It should be noted that the extension cannot display quantity elements for bundle, configurable or grouped products directly on product lists.

If you are looking to add quantity boxes to your themes product list template, or if you are still uncertain about how to apply the modifications specified above, please take a look at our template example: template_sample.txt

Please do not simply copy paste the modifications from this file as it is merely an example, and it's more than likely your template file will look different from ours.

You will also need to enable the extension for usage with product collections in order to make it appear of your product lists. By default this is turned off to conserve resources.

Quantity Option Label Affix

You may also need to specify the injection locations, meaning URL's where the script files to place and handle quantity option elements meant for product lists will be included. By default the extension includes the most common locations where you would want to include this functionality, category pages and product search result pages.

The image below shows a few examples of what URL values can be used and the table below that explains how they are interpreted by the extension.

Injection Locations
Value Description
catalog/category/view Module = catalog, Controller = category, Action = view
catalogsearch/* Module = catalogsearch, Controller = any (asterisk = catch all), Action = any (since it's not defined it's not compared)
catalog/product/view/id/16 Relative paths are prefixed with the websites base url before comparison. Get parameters prefixed with a question mark (?) or ampersand (&) symbol are not included in the comparison check.
http://ext.vagrant.magep
arts.com/index.php/catal
og/product/view/id/16?te
sting=test&test=test2
Absolute paths are compared directly against the current URL the customer is viewing, including all parameters. The protocol (http / https) is however corrected prior to comparison.

If you require any help applying the necessary modifications our support team is always available to help you out: info@mageparts.com.

Chapter 6: Shopping Cart Functionality

Consider that you have a quantity options table set up like the image below.

Quantity Option Table

If a client were to add first "5" of some product to their cart, continue shopping and decide to add another "3" of the same item to their cart, it would invoke a problem since "8" isn't an available quantity option.

We have solved this problem through the setting Method For Handling Unavailable Quantities.

Method For Handling Unavailable Quantities
Option Description
Create Separate Entry in Cart According to the example above 2 items would have been created, one with the quantity "5", and another with the quantity "3". If the customer were to add the item yet again to the cart the extension would attempt to merge the item with the ones already in the cart.
Display an Error Message Selecting this option will display a text below just below the setting where you can enter the message you would like to present the client with.

As an additional side note to the setting explained above, if you've selected the Display an Error Message alternative, you can use %s in your Error Message to include the requested quantity, and a secondary %s to include the current quantity of the cart item.

If you would like to automatically update the cart as the customer changes the quantity of items in it you can enable the setting Reload Cart When Changing Quantity as displayed on the image below.

Reload Cart When Changing Quantity

In case you for some reason would like to allow items to have a price of zero (0), you can enable the Allow Zero Price setting, otherwise it's recommended to leave that as disabled.

Allow Zero Price

Chapter 7: Cache

The cache lifetime can be regulated from a setting in the system configuration. It's recommended to leave this setting set to "Never" unless you've good reason too. When set to "Never" the cache will still automatically refresh when it's required too (for example when you change the system configuration or edit one of your products).

Cache Settings

When editing a product only the cache for that specific product, and possible child products in case it's a configurable, grouped or bundled product, will be refreshed.

You can manually refresh or turn of the cache for the extension from System → Cache Management.

Cache Page

Chapter 8: Ajax Features

Currently the only pre-packaged Ajax feature is only used for configurable products and is meant to fetch product specific quantity option settings as the clients selects options for the configurable product, rather than loading the settings for all child products when the page renders.

Without any development experience it may be difficult to understand why that might be useful, but under certain circumstances it can greatly improve performance. If you do not have any performance issues however it's advised to leave this feature turned off.

Ajax Settings

Chapter 9: Theme Specific Settings

Currently the only theme specific settings are the Element Paths settings, and these shouldn't be touched unless you know exactly what you are doing.

By default, the extension will attempt to find the original quantity box by looking at its name attribute. This is an attribute which is very unlikely to change. In the event that a designer would have changed it though the extension will attempt to locate the quantity text box using the values of the Element Paths settings.

These settings are pre-configured to be as general as possible, though in certain cases you may have to change them in order for the extension to function with your theme.

Element Paths

If you do not understand these settings but believe you have to change them it's recommended that you contact our support staff at info@mageparts.com first for advise.

Chapter 10: Mass Updating Quantity Option Settings

If you need to change a quantity option setting to the same value for multiple products you can do so quickly by using the mass action Update Attributes.

1) Navigate to Catalog → Manage Products in the top menu.

2) Select the products you wish to change by ticking the checkbox on their rows in the product grid (you can select records, use the filters at the top of the grid to search for other records and select them as well, your selection is remembered between searches).

3) Select the option "Update Attributes" from the Actions select box in the top right-hand corner of the product grid.

4) Click on the "Submit" button, right next to the Actions select box.

Mass Update Example

You will be taken to a new screen similar to the one shown when editing a single product record.

Click on the Inventory tab in the left-hand menu. At the bottom of the page you will see the quantity option settings, just as you normally would when editing a single product.

Mass Update Example

Please note that in order to change a value you will have to tick the checkbox labeled Change beneath the setting you wish to edit.

Mass Update Example

When you've applied the changes you wanted to make just click on the Save button in the upper right-hand corner of the page and wait for the changes to be applied on all the products you selected.

Chapter 11: Uninstalling the Extension

This chapter explains how to completely uninstall the extension.

If you should face any problems with the uninstallation it's suggested that you contact our support staff for advise at info@mageparts.com.

11.1Removing Files

The first step is to remove all of the files included in the extension from your installation. If you are uncertain about where all of the files are located please refer to the installation manual for a complete directory tree.

11.2Removing Attributes

1) Navigate to Catalog → Attributes → Manage Attributes in the top menu.

2) Type "ddq_" in the filter field labeled Attribute Code and click on the "Search" button at far right-hand side of the attribute grid.

You should now see a list of six (6) attributes (ddq_enabled, ddq_hide_unavailable_qty, ddq_incremental, ddq_layout, ddq_preselected and ddq_qty_list).

Attributes

Click on each of these in turn and remove them by click on the "Delete Attribute" button at the top of the page which appears.

11.3Refreshing Cache & Index

1) Navigate to System → Cache Management in the top menu.

2) Select all of the cache options by clicking on the "Select All" link at the top left-hand corner of the cache grid.

3) Select "Refresh" from the Actions drop-down at the top right-hand corner of the grid.

4) Click on the "Submit" and wait while the cache refreshes. This can take several minutes.

Refresh All Cache Types

5) Navigate to System → Index Management in the top menu.

6) Select all of the index options by clicking on the "Select All" link at the top left-hand corner of the index grid.

7) Select "Reindex Data" from the Actions drop-down at the top right-hand corner of the grid.

8) Click on the "Submit" and wait while the indexes are refreshed. This can take several minutes.

Refresh All Index Types