Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CON-586 #35

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Actindo/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Shopware_Plugins_Core_Actindo_Bootstrap extends Shopware_Components_Plugin
* the version number MUST match this regex (in order for the update mechanism to work):
* ^\d+\.\d+$
*/
const VERSION = '2.270';
const VERSION = '2.271';

/**
* the installed shopware version must be this or greater, otherwise this plugin won't install
Expand Down
21 changes: 21 additions & 0 deletions Actindo/Components/Service/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,18 @@ protected function updateProduct($articleID, &$product) {
$this->_updateVPE($product, $update);
$this->_updateVariants($product, $update, $articleID);
$articles = $this->resources->article;
/**
* Enlight Filter Event
*/
$update = Enlight_Application::Instance()->Events()->filter(
'ActindoConnector_Product_Update_ArticleFilter',
$update,
array(
'subject'=>$this,
'id'=>$articleID,
'product'=>$product
)
);
try
{
$articles->update($articleID, $update);
Expand All @@ -1034,8 +1046,17 @@ protected function updateProduct($articleID, &$product) {
$result = Shopware()->Db()->query($sql);
$firstVairantArticleId = $result->fetch(PDO::FETCH_ASSOC);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in variable name

$firstVairantArticleId = $firstVairantArticleId['id'];
/**
* Clean Up DB
*/
$sql = 'UPDATE s_articles SET main_detail_id='.(int)$firstVairantArticleId.' WHERE id='.(int)$articleID.';';
Shopware()->Db()->query($sql);
//Reset Kinds
$sql = 'UPDATE s_articles_details set kind=2 WHERE articleID='.(int)$articleID.';';
Shopware()->Db()->query($sql);
//now set the main Article ID
$sql = 'UPDATE s_articles_details set kind=1 WHERE id='.(int)$firstVairantArticleId.';';
Shopware()->Db()->query($sql);
//trigger update again, it will continue without doing the complete update process (only the stuff that has not been created so far
try
{
Expand Down