Sudden Sitewide Slowdown after OPC install

If you are runnig Joomla 3.x and Virtuemart 3.x please post to this forum your questions or support tickets about One Page Checkout

Sudden Sitewide Slowdown after OPC install

Postby derekwebster@.....com » Fri Jul 05, 2019 12:57 pm

Hi I wonder if you can help - Ive experienced a SUDDEN site wide slowdown after installing OPC. pre install My pages were almost instant refresh page navigation was VERY quick. Now - any Virtuemart page is taking an incredible amount of time to load - or timing out completely.
Ive tried changing templates to standard ones. Still same issue.

Ive now uninstalled OPC and still the same.

Can you think of any reason this could have happened?
derekwebster@.....com
 
Posts: 11
Joined: Tue Jan 27, 2015 5:25 pm

Re: Sudden Sitewide Slowdown after OPC install

Postby derekwebster@.....com » Mon Jul 08, 2019 1:32 pm

Appploies but I think this slowdown was due to another issue.

Under Add the "raleted products' custom field - When I enable "With 'Add to Cart' button" the whole site seems to go into meltdown - lol - Server load went up - pages completely unresponsive. Backend slow. I may have found a VM bug.

Many thanks
derekwebster@.....com
 
Posts: 11
Joined: Tue Jan 27, 2015 5:25 pm

Re: Sudden Sitewide Slowdown after OPC install

Postby admin » Mon Jul 29, 2019 2:59 pm

hello, VM is very ineffecient in handling custom fields and i would suggest to modify sublayout/customfields to prevent any sort of recursion there. the main problem is that it loads related products of related products and then possibly another related products, until your site either crashes or is very slow.

i generally do not suggest to use related products if you cannot have a dev which can fix the above issue for you.

we've got some custom systems that store related products in comma separated columns in custom tables where they get imported from external systems via sync software. then our system at vm templates load this extra information and shows the related products at another positions wherever needed.

example :
Code: Select all

$this->alternative_products_html = '';
if (!empty($this->product->extra['alternative_products_vm'])) {
   $ids = explode(',', $this->product->extra['alternative_products_vm']);
   
   
if (!empty($ids)) {
   $products = $this->product_model->getProducts ($ids);
      if (!class_exists ('vmCustomPlugin')) {
                  require(JPATH_ADMINISTRATOR.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_virtuemart'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR . 'vmcustomplugin.php');
               }
            $this->product_model->addImages($products,1);
            foreach ($products as $k=>$prod) {
               if (empty($prod->images[0])) {
                  if (class_exists('VmMediaHandler')) {
                  $products[$k]->images[0] = new VmMediaHandler();
                  }
                  else {
                     if (class_exists('VmImage')) {
                        $products[$k]->images[0] = new VmImage();
                     }
                     
                  }
               }
               
               
               
               $products[$k]->stock = $this->product_model->getStockIndicator($products[$k]);
               
               
               
               
               
            }
            //shopFunctionsF::sortLoadProductCustomsStockInd($products,$this->product_model);
            ob_start();
            require(JModuleHelper::getLayoutPath('mod_virtuemart_product_custom','default'));
            $this->alternative_products_html = ob_get_clean();
            
            
}

   
}




1. the code above expects the comma separated list of alternative/related/etc products within:
$ids = explode(',', $this->product->extra['alternative_products_vm']);

2. dependencies: $this->product_model = VmModel::getModel('products'); (usually available in product's default template )

3. mod_virtuemart_product_custom (which is a custom mod of mod_virtuemart_product ) (renders products via sublayouts/products.php )

best regards,stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 3 on Joomla 3.x