Jump to content

How to download/install a bug fix


Recommended Posts

I would like to know how to download and install a recent bug fix.  The team has posted the following in the bug report that I created:  (PSCFV 11530)

 

This bug has been fixed.

https://github.com/PrestaShop/PrestaShop/commit/383bd3a8e35c1fb08ba0beae3cdcc4457481d139

 

When I go to the link, I see some code that looks like it might have been modified?  I'm not a programmer so I'm not sure what I am seeing.  

 

Is there some way to download and install this "fix" onto my website?  Or do I have to wait until the fix comes out in a release?

 

Any thoughts will be appreciated.

Thanks

Frank Carey

Link to comment
Share on other sites

Hi,

 

You can make an override for this fix method of AdminCountriesController class.

 

To override, just create an AdminCountriesController.php file on ./override/controllers/admin/ folder , and paste into this code :

<?php

class AdminCountriesControllerCore extends AdminController
{
	public function processUpdate()
	{
		$country = $this->loadObject();
		if (Validate::isLoadedObject($country) && Tools::getValue('id_zone'))
		{
			$old_id_zone = $country->id_zone;
			//we change zone for states attached to this country, only if they have the same id zone before change
			if (parent::processUpdate())
			{
				$results = Db::getInstance()->executeS('SELECT `id_state` FROM `'._DB_PREFIX_.'state` WHERE `id_country` = '.(int)$country->id.' AND `id_zone` = '.(int)$old_id_zone);
				$ids = array();
				foreach ($results as $res)
					$ids[] = (int)$res['id_state'];
				
				Db::getInstance()->execute(
					'UPDATE `'._DB_PREFIX_.'state` 
					SET `id_zone` = '.(int)Tools::getValue('id_zone').' 
					WHERE `id_state` IN ('.implode(',', $ids).')');
			}
		}
		else
			parent::processUpdate();
	}
}

?>

Regards

Edited by DevNet (see edit history)
Link to comment
Share on other sites

DevNet,

 

Thanks for your reply.  I followed your instructions and created the new file in the /override sub-directory.  However, the "fix" doesn't seem to have any effect on my site.  Here's what I'm trying to do.  Maybe you can give me some ideas?

 

I enabled the country "Sweden" under Localization/Countries

It belongs to the "Europe" zone

I created a carrier called "Papasworkshop to Sweden" and I set the shipping price to "Europe-Zone" at $16.00

In my main product I enabled "Papasworkshop to Sweden" under the Shipping Tab

 

When I select a Sweden address and try to ship a product to Sweden I get the message "no carriers available"

 

So I go back and select a USA address and I get my normal USPS shipping options....PLUS I get a choice that says:

Papasworkshop to Sweden
10-14 days
The best price
Free

 

My shipping charges to Sweden are $16.00 so I certainly don't want it to be FREE.

Also,this option for shipping to Sweden shouldn't be coming up when I choose a NorthAmerica/United States address.

 

I've noticed that a lot of people seemed to have problems getting the "no carriers available" message.  Many of the suggestions have pointed to Shipping configuration problems.  I've gone through the shipping setup many times and I think I understand it however I could certainly be doing something wrong and not realize it.

 

Note: since my USPS module only ships within the USA, I'm trying to set up fixed shipping charges to other countries.  I thought maybe I could set up individual Carriers with a fixed price for each.  Such as

Papasworkshop to Canada        $ 9.50

Papasworkshop to Sweden        $ 16.00

 

Any thoughts you might have would be appreciated.

Link to comment
Share on other sites

×
×
  • Create New...