Fractional Stock

Allows you to sell a certain amount of goods or goods with a floating value. You can sell food products (in grams, kilograms), products sold in packages (boxes, boxes) and other things that have a floating amount
Please enter a valid addres(es) of the shop where you are going to use the add-on.
15 200 
Latest module version 2.10.1 Updated: 12.11.2024
Have questions about the module? Write to us: HelpDesk
30 days for return
If you are not satisfied with the operation of the module, we will return your money with bonus points in your Personal Account
Bonus for review
We will give 1000 bonus points in your Personal Account for a review after purchasing the module
Multi-display
One price regardless of the number of display cases, no need to pay extra
Support
Free consultation and support on the module, assistance with installation
Discount for revision
We will give a discount of up to 50% on improvements to any functionality when purchasing a module from us

By default, CS-Cart does not have the ability to work with fractional values of product balances; this causes great inconvenience for owners of grocery stores, construction materials stores, and printing houses. Any product where you need to operate with fractional values.

Another problem is selling goods in packages; you can set the product quantity step, but it will not be clear how many packages the client will receive. Or you sell goods in packages, but count them in the warehouse in pieces, or in weight (kg, g, t) or volume (m3, l3)

Our add-on solves 2 problems at once and allows you to sell goods in fractional parts and packages

Image

You can flexibly configure the add-on for each product individually or for the entire store as a whole, or add exceptions.

The add-on supports displaying the unit of measurement of the quantity of goods, setting the step for selecting quantity, the minimum and maximum quantity of goods to order. It solves the problems of displaying available products on the site and simplifies the sales process.

Image

Selling goods in packages is now very flexible and understandable for both the store owner and the client. You can:

  • Sell only in packages and display packages;
  • Sell in packages and show how many units of goods the client will receive;
  • Sell in pieces and show and let you add the product to your cart in packages.

In this case, you will count the goods individually (in whole numbers or fractions) and you can configure this individually for each product.

Image

Add-on features

  • Sale of goods in fractional units;
  • Setting the unit of measurement for the quantity of goods. Both globally and locally;
  • Disable fractional balance for units included in exceptions;
  • Setting the step for selecting the quantity of goods to order;
  • Setting the minimum and maximum values for the order;
  • Customizable display for sale in packages;
  • Customizable display of the quantity in the cart;
  • Compatible with Unitheme and Youpi templates.

Product:
  • Store Builder
  • Store Builder Ultimate
  • Multi-Vendor
  • Multi-Vendor Plus
  • Multi-Vendor Ultimate
Recipient:
  • Buyers
  • Owners
  • Vendors
Development
:
  • Backend
  • Frontend
Localization:
  • English
  • Русский
Compatible versions:
  • 4.17.X
  • 4.16.X
  • 4.15.X
  • 4.14.X
  • 4.13.X
  • 4.12.X

Installation

After downloading the add-on, its installation is performed using standard CS-Cart tools on the page Admin Panel → Add-ons→ Add-ons Management → Download and install the add-on (+).

For CS-Cart version 4.13.1 and higher, the Admin Panel → Add-ons→ Downloaded add-ons → Gear button → Manual installation.

Image

Installing hooks

To work correctly, you need to install hooks according to the instructions. The information is collected in the add-on tab Information.

This operation for adding hooks is relevant for the current version of the v add-on .2.5.13 and later, in future versions, this operation may no longer be necessary.

Image

To display the quantity of the product in the cart, you need to add 3 hooks to the file “fn.cart.php”:

  1. Open the file fn.cart.php (the file will be located at the path: app/functions/fn.cart.php );
  2. In the opened file, find the line with the code (approximately between lines 6057-6062):
    1. if (!empty($product['qty_step']) && $product['qty_step'] > $min_qty) {
              $min_qty = $product['qty_step'];
      
  3. After the found line, insert the code:
    1. fn_set_hook('check_amount_in_stock_min_qty', $product, $min_qty, $product_id);
      
  4. As a result, you should get the following:
    1. if (!empty($product['qty_step']) && $product['qty_step'] > $min_qty) {
              $min_qty = $product['qty_step'];
          }
      
      
          **fn_set_hook('check_amount_in_stock_min_qty', $product, $min_qty, $product_id);**
      
          $cart_amount_changed = false;
      
      Image
  5. Next, find the line with the code in the file (approximately between lines 6522-6524):
    1. $amount = fn_normalize_amount(@$data['amount']);
      
  6. After the found line, insert the code:
    1. fn_set_hook('add_product_to_cart_post_normalize_ammount', $product_id, $amount, $data);
      
  7. As a result, you should get the following:
    1. $amount = fn_normalize_amount(@$data['amount']);
      
      **fn_set_hook('add_product_to_cart_post_normalize_ammount', $product_id, $amount, $data);**
      
      if (!isset($data['extra']['exclude_from_calculate'])) {
      
      Image
  8. Next, find the line with the code in the file (approximately between lines 9340-9342):
    1. $amount = fn_normalize_amount($v['amount']);
      
  9. After the found line, insert the code:
    1. fn_set_hook('update_cart_products_normalize_amount_post', $amount, $v);
      
  10. As a result, you should get the following:
    1. $amount = fn_normalize_amount($v['amount']);
      
      **fn_set_hook('update_cart_products_normalize_amount_post', $amount, $v);**
      
      $v['extra'] = empty($cart['products'][$k]['extra']) ? array() : $cart['products'][$k]['extra'];
      
      Image
  11. Save the changes to the file;
  12. Clear the cache:
    1. In the admin panel, select Administration → Storage → Clear Cache.
      1. Image

To work with commerceml, you need to add a hook to the file “OrderConvertor.php ”:

  1. Open the file OrderConvertor.php (the file will be located along the path: app/addons/commerceml/src/Convertors/OrderConvertor.php);
  2. In the opened file, find the line with the code (approximately between lines 44-46):
    1. $order->id->external_id = $element->getAsString('id');
      
  3. After the found line, insert the code:
    1. fn_set_hook('commerceml_order_convertor_convert_pre', $element, $import_storage, $order);
      
  4. As a result, you should get the following:
    1. $order->id->external_id = $element->getAsString('id');
      
              **fn_set_hook('commerceml_order_convertor_convert_pre', $element, $import_storage, $order);**
      
          foreach ($element->get('products/product', []) as $item) {
      
      Image
  5. Save the changes to the file;
  6. Clear the cache:
    1. In the admin panel, select Administration → Storage → Clear Cache.
      1. Image

Setting

Add-ons Settings (Global Settings)

Go to the section Add-ons → Downloaded add-ons→ Fractional stock→ Settings tab

Basic Settings:

The settings tab is divided into 3 sections, Global settings for products, Global Settings for packages, and Shopping cart settings.

The application of these settings affects all products of the store at once, unless local settings are set for the product (more on this below).

Global settings for products

Use fractional remainder - Enabling this function will allow you to edit the field: Unit of quantity.

Example

Global settings for packages

The product is for sale:

  • Piece by piece - goods are sold in pieces, all goods (unless another setting is selected locally for the product/package sale is enabled) will be sold in a piece or similar form;
  • Packages - goods are sold in packages, you can specify:
    • The quantity of goods in a package is the step of changing the quantity of goods that will be applied to goods sold in packages;
    • Image

Options for displaying the selection of the quantity of the product:

  • Show the number of packages - Display only the counter with the number of packages in the product card and catalog;
Image
  • Show the quantity of goods and packages - Display in the product card and catalog a counter with the number of packages and the number of goods in the package.
Example

Shopping Cart Settings

Quantity display mode on the basket icon - Allows you to select the display option on the basket icon:

  • Number of items - how many types of goods are in the basket;
Image
  • Number of units - how many units of the product are in the basket;
Image
  • Do not display.
Image

In the add-on settings, the Display tab contains settings responsible for displaying units of measurement and methods of sale on the showcase.

Image
  • Display units of measurement in sellers' offers
    • When this function is enabled on the showcase, the seller's offers will display the unit of measurement of the product specified in the global settings of the add-on or the local settings of the product.

Image
  • Display all sales methods on the categories page
    • This and all subsequent settings are responsible for displaying all sales methods on the pages and blocks of your choice.

Image
Example

In the add-on settings, the Information tab displays the instructions for adding hooks described at the beginning of this instruction.

Add-ons Settings (Local Settings)

Go to the section Products → Products → Open the product to set up the fractional stock→ Go to the Add-ons tab → Find the block MS: Fractional Stock.

Image
⚠️
Local product settings have a higher priority and may override global settings for the entire store.

Product Settings

Use a fractional remainder

  • Global Settings:
    • The unit of measurement of quantity from the global settings of the add-on will be used for the product;
    • For the product, you can specify:
      • Step of the quantity selection list;
      • Minimum quantity of goods to order;
      • The maximum quantity for the purchase of one product.
      • ⚠️
        This setting option is suitable for stores where all or most of the products have the same unit of quantity, for example, in grams.
        Example
      • Yes:
        • A fractional remainder will be used forcibly for the product;
        • For the product, you can specify:
          • The unit of measurement of quantity;
          • Step of the quantity selection list;
          • Minimum quantity of goods to order;
          • The maximum quantity for the purchase of one product.
          • ⚠️
            This setting option is suitable for stores where you need to set a fractional quantity sale for certain products.
            Example
          • No:
            • The fractional balance will be forcibly turned off for the product;
            • For the product, you can specify:
              • The unit of measurement of quantity.
              • ⚠️
                This setting option is suitable for stores where only the unit of quantity measurement needs to be set for goods.
                Example

                Packaging Settings

                The product is sold in packages

                • Global Settings:
                  • Global settings for packages will be used for the product;
                  • Fields are not editable for the product:
                    • The quantity of the product in the package;
                    • Options for displaying the selection of the quantity of the product;
                    • ⚠️
                      This option is suitable for stores that sell all products with the same terms of sale.
                      Example
                    • Yes:
                      • For a product, you can set the quantity of the product in the package;
                      • For the product, you can select options for displaying the selection of the quantity of the product;
                        • ⚠️
                          This option is suitable for stores that sell goods with different quantities in a package.
                    • No:
                      • The product is sold in pieces, global settings do not affect the product, local fields are not editable.

                    Mass editing

                    Through updating products in CS-Cart:

  1. Open the Products → Products;
  2. Select the necessary products;
  3. Click Edit Selected;
    1. Image
  4. Select fields to edit;
    1. Image
  5. Click Edit Selected;
  6. Enter new values for the selected fields; Meaning global - Global Settings Y - Yes N - No
    1. Image
  7. Click Save.

Through the export and import of goods:

  1. Open the Administration → Export Data → Products;
  2. Move the following fields from the list of available fields to the exported fields: MS:Allow Fractional Amount MS:Product Amount Step MS:Product minimum order quantity MS:Product maximum order quantity MS:Product Amount Postfix MS:Product Sale Type MS:Show Sale Types These fields will be displayed in a table file for editing fractional remainder settings
    1. Image
  3. Click Export;
  4. Make the necessary changes in the table file and save;
  5. Open the Administration → Data Import → Products section;
  6. Press the + button;
  7. Select a table file;
  8. Go to the next step Matching fields;
  9. Match the fields as shown below:
    1. Image
  10. Click Import.

v2.5.13 11/14/2023

[-] Removed unnecessary, commented-out code

[!] Field MS: "Minimum quantity of goods for order" does not work. Corrected

[!] The "Quantity unit" field in the settings is not translated. Corrected

[!] Correct display in the product card

[*] Current line numbers for adding add-on hooks

[+] Added information about adding add-on hooks

[!] Added types of displaying the quantity of goods on the cart icon

[!] Displaying fractional values in the cart

[!] Displaying the product quantity counter in the product card

[+] Add-onstandardization

v2.5.12 from 10/23/2023

[!] Correct counting of packages on the cart page

[!] Availability of the service on the order page in the administrative panel

[!] The "Quantity unit" field in the product settings has been changed to the "float" type

[!] Fields related to quantity selection only store positive values

[!] In the field MS: "Minimum quantity of goods for order" only entering digital values is available

[*] Standardization of language variables

v2.5.11 from 10/16/2023

[*] Changed short tags to regular

[*] Add-on settings have been reworked

v2.5.10 from 07/18/2023

[!] Correct display in the product card

[!] Loading icons

[!] Field "Product quantity step" saves only positive values

[!] Correct display of unit names on the pages of promotional products, new items, bestsellers and search results

[!] Displaying units of measurement on the deferred page

v2.5.9 from 06/25/2023

[+] Add-on standardization

v2.5.8 from 06/12/2023

[+] Add-on standardization

v2.5.7 from 06/08/2023

[*] The style in the "Bestsellers" block has been corrected if it opens in the product card

v2.5.6 from 06/05/2023

[+] Added a setting for displaying fractional balances in the import and export of goods

[+] Added settings and adjustments for displaying all sales methods on different pages

[+] Added a setting for displaying units of measurement in the block of offers from sellers in the product card

[!] Fixed a bug that breaks the category view page

v2.5.5 from 05/20/2023

[+] Added a setting for displaying fractional balances in the product card on the product editing page in the admin panel

v2.5.4 from 05/16/2023

[*] Minor changes to the qty.override.tpl template

v2.5.3 from 05/16/2023

[!] Fixed an error when adding a product to the cart when the "General products of sellers" add-on is running

v2.5.2 from 05/15/2023

[*] Licensing

v2.5.1 from 05/10/2023

[!] Fixed import of the product_amount_postfix field

Reviews

Here you can share your opinion and evaluate our work.

Your feedback helps us become better and offer you even better service.

Similar add-ons