User Tools

Site Tools


udropship:umarketplace:m2:enable_disable_multiprice

M2: Instructions to enable/disable price comparison

Important Note about modules usage

Once you have Price Comparison module installed you have price indexer tables modified and you need to enable the modules functionality by setting proper decision method. You need to set this configuration:
Configuration > Drop Shipping > Product Stock Options > Vendor Decision Method = Multi Vendor: Least Packages + Lowest Cost. Otherwise you will experience problems with price indexer. If you find out that price comparison functionality is not what you need or you just want to temporary disable it follow process described in Disable section. If eventually you decide to use them follow Enable section.

Disable

  1. Change decision method from Multi Vendor: Least Packages + Lowest Cost to either Always use assigned vendor or When in stock use local, otherwise use vendor in
    Configuration > Drop Shipping > Product Stock Options > Vendor Decision Method
  2. then run these sql queries
    alter table catalog_product_index_price_final_tmp drop udmp_new_min_price, drop udmp_new_max_price, drop udmp_new_cnt, drop udmp_used_min_price, drop udmp_used_max_price, drop udmp_used_cnt;
    alter table catalog_product_index_price_final_idx drop udmp_new_min_price, drop udmp_new_max_price, drop udmp_new_cnt, drop udmp_used_min_price, drop udmp_used_max_price, drop udmp_used_cnt;
    alter table catalog_product_index_price_tmp drop udmp_new_min_price, drop udmp_new_max_price, drop udmp_new_cnt, drop udmp_used_min_price, drop udmp_used_max_price, drop udmp_used_cnt;
    alter table catalog_product_index_price_idx drop udmp_new_min_price, drop udmp_new_max_price, drop udmp_new_cnt, drop udmp_used_min_price, drop udmp_used_max_price, drop udmp_used_cnt;
    alter table catalog_product_index_price drop udmp_new_min_price, drop udmp_new_max_price, drop udmp_new_cnt, drop udmp_used_min_price, drop udmp_used_max_price, drop udmp_used_cnt;
    alter table catalog_product_index_price_cfg_opt_agr_idx drop udmp_new_min_price, drop udmp_new_max_price, drop udmp_new_cnt, drop udmp_used_min_price, drop udmp_used_max_price, drop udmp_used_cnt;
    alter table catalog_product_index_price_cfg_opt_agr_tmp drop udmp_new_min_price, drop udmp_new_max_price, drop udmp_new_cnt, drop udmp_used_min_price, drop udmp_used_max_price, drop udmp_used_cnt;
    alter table catalog_product_index_price_cfg_opt_idx drop udmp_new_min_price, drop udmp_new_max_price, drop udmp_new_cnt, drop udmp_used_min_price, drop udmp_used_max_price, drop udmp_used_cnt;
    alter table catalog_product_index_price_cfg_opt_tmp drop udmp_new_min_price, drop udmp_new_max_price, drop udmp_new_cnt, drop udmp_used_min_price, drop udmp_used_max_price, drop udmp_used_cnt;
  3. then disable modules: run this command
    bin/magento module:disable Unirgy_DropshipMulti Unirgy_DropshipMultiPrice Unirgy_DropshipSellYours
  4. and finally flush cache storage: bin/magento cache:flush

You need to perform all that actions because Price Comparions add-on adds extra columns to magento price indexer index tables which will break indexer if you just disable modules.

Enable

To enabled modules back after you disabled them follow these steps:

  1. run this sql command: delete from setup_module where module in ('Unirgy_DropshipMulti', 'Unirgy_DropshipMultiPrice', 'Unirgy_DropshipSellYours');. You need to do this to trigger reinstall process which will add necessary custom fields in indexer tables (otherwise price comparison custom price indexer won't work).
  2. enable modules using: bin/magento module:enable Unirgy_DropshipMulti Unirgy_DropshipMultiPrice Unirgy_DropshipSellYours
  3. run bin/magento setup:upgrade to reinstall modules (add custom indexer fields that we removed during modules disable process)
  4. change decision back to Multi Vendor: Least Packages + Lowest Cost in Configuration > Drop Shipping > Product Stock Options > Vendor Decision Method. This one is necessary to turn on modules logic in the system.
udropship/umarketplace/m2/enable_disable_multiprice.txt · (external edit)