Skip to content

Instantly share code, notes, and snippets.

View maxout's full-sized avatar
🏠
Working from home

Heiko Bee maxout

🏠
Working from home
View GitHub Profile
@maxout
maxout / gist:077dc40abafe7d6d93ef86cd01a6ed12
Created December 19, 2023 10:40
bin/build-storefront.sh on Apple Silicon
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 bin/build-storefront.sh
@maxout
maxout / seo_urls_sw5.sql
Created June 29, 2023 06:37
selects rewrite urls from SW5 Database
SELECT DISTINCT scru.org_path,scru.path, sad.ordernumber, SUBSTRING_INDEX(scru.org_path,'=',-1) AS aid from s_core_rewrite_urls scru
LEFT JOIN s_articles_details sad ON sad.articleID = SUBSTRING_INDEX(scru.org_path,'=',-1)
WHERE scru.org_path LIKE "sViewport=detail&sArticle=%"
GROUP BY scru.org_path
@maxout
maxout / rsync_sw
Last active February 6, 2023 12:42
copy shopware instance to subfolder
rsync -av --progress . ./stage --exclude stage
@maxout
maxout / elvca
Created June 19, 2022 13:41
replace string in column
UPDATE property_group_option_translation SET custom_fields= REPLACE (custom_fields ,'search','replace');
@maxout
maxout / update_customfield.sql
Created March 1, 2022 11:38
Update customField Shopware 6
UPDATE product_translation SET custom_fields = JSON_SET(custom_fields,"$.recipes", NULL);
@maxout
maxout / add_state_machine_state.sql
Created February 28, 2022 16:24
Adds a custom State Machine State
INSERT INTO `state_machine_state` (`id`, `technical_name`, `state_machine_id`, `created_at`, `updated_at`) VALUES(0xC4D5A7E42A4741568FD6DDC5819B3A0E, 'clarification_required', 0xCEC9270BA8804885A8C91074E8BA0282, '0000-00-00 00:00:00.000', NULL);
INSERT INTO `state_machine_state_translation` (`language_id`, `state_machine_state_id`, `name`, `custom_fields`, `created_at`, `updated_at`) VALUES(0x2FBB5FE2E29A4D70AA5854CE7CE3E20B, 0xC4D5A7E42A4741568FD6DDC5819B3A0E, 'klärung Notwendig', NULL, '0000-00-00 00:00:00.000', NULL),(0xFA4FC3F8247147538CA4F00B156F4BB5, 0xC4D5A7E42A4741568FD6DDC5819B3A0E, 'Clarification Required', NULL, '0000-00-00 00:00:00.000', NULL);
INSERT INTO `state_machine_transition` (`id`, `action_name`, `state_machine_id`, `from_state_id`, `to_state_id`, `custom_fields`, `created_at`, `updated_at`) VALUES(0x2fbb5fe2e29a4d70aa5864ce7ce3e31b, 'clarification', 0xCEC9270BA8804885A8C91074E8BA0282, 0xBE17F95BFE4E475C97A7BED180FED69C, 0xC4D5A7E42A4741568FD6DDC5819B3A0E, NULL, '0000-00-00 00:00:00.000',
@maxout
maxout / SELECT_FROM_JSON_STRING.sql
Last active February 18, 2022 16:34
SELECT from JSON String
SELECT p.id,p.manufacturer_number ,pt.product_id,JSON_EXTRACT(custom_fields, '$.custom_rim_details_number')
FROM product_translation pt
INNER JOIN product p ON pt.product_id = p.id
WHERE JSON_EXTRACT(custom_fields, '$.custom_rim_details_number') IS NOT NULL
AND JSON_EXTRACT(custom_fields, '$.custom_rim_details_number') != 'null';
@maxout
maxout / select_products_no_manufacturer.sql
Last active February 18, 2022 17:11
get all products with manufacture that not exists in SW6
SELECT * FROM `product` WHERE product_manufacturer_id not in (SELECT id from product_manufacturer)
@maxout
maxout / sGetArticlesByCategory.php
Last active March 1, 2022 08:08
Shopware: The following example selects a list of products assigned to the category with id 3 and sorts the result set by the cheapest price.
$criteria = new Criteria();
$criteria->limit(10);
$criteria->addCondition(new CategoryCondition([3]));
$criteria->addSorting(new PriceSorting());
$context = $this->get('shopware_storefront.context_service')->getShopContext();
$service = $this->get('shopware_search.product_number_search');
/**@var $result ProductNumberSearchResult*/
$result = $service->search($criteria, $context);
@maxout
maxout / Bootstrap.php
Created November 21, 2016 08:11 — forked from vielhuber/Bootstrap.php
PHP: Shopware 4 - Disable variants for sold out articles
<?php
class Shopware_Plugins_Frontend_GlassesStockVariant_Bootstrap extends Shopware_Components_Plugin_Bootstrap {
public function getCapabilities() {
return array(
'install' => true,
'update' => true,
'enable' => true
);
}