Skip to content

Instantly share code, notes, and snippets.

View maxout's full-sized avatar
🎯
Focusing

Heiko Bee maxout

🎯
Focusing
View GitHub Profile
@maxout
maxout / getCheckoutUrl.php
Created November 6, 2015 11:48
Sprd:getCheckoutUrl
<?php
/**
* Retrieve Basket Checkout URL
* Returns the checkout URL for the current basket that will used in the iFrame on shop checkout.
* @param $basketUrl
* @param $namespaces
* @return string
*/
private function getCheckoutUrl($basketUrl, $namespaces)
{
@maxout
maxout / basketItem.xml
Created November 6, 2015 11:50
Sprd:basketItem
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<basketItem xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://api.spreadshirt.net">
<links>
<link type="edit" xlink:href="http://shopware-sprd.maxout.de/"/>
<link type="continueShopping" xlink:href="http://shopware-sprd.maxout.de"/>
</links>
<quantity>1</quantity>
<element type="sprd:product" xlink:href="http://api.spreadshirt.net/api/v1/shops/436258/product/134011849">
<properties>
<property key="appearance">4</property>
@maxout
maxout / change_ordernumbers_incrementally.sql
Last active March 1, 2022 08:07
Shopware change ordernumbers incrementally with prefix
select @i := 200000;
update s_articles_details set `ordernumber` = CONCAT('STM-',(select @i := @i + 1));
@maxout
maxout / find duplicate ordernumbers.sql
Last active March 1, 2022 08:05
find duplicate order numbers in shopware s_order
SELECT `id`, `ordernumber` FROM s_order WHERE EXISTS ( SELECT `id` FROM s_order dub WHERE s_order.`ordernumber` = dub.`ordernumber` AND s_order.`id` <> dub.`id`) ORDER BY `ordernumber`
@maxout
maxout / delete duplicate order numbers.sql
Last active March 1, 2022 08:06
delete duplicate order numbers from shopware s_order
DELETE FROM s_order USING s_order, s_order as Dup WHERE NOT s_order.`id` = Dup.`id` AND s_order.`id` <> Dup.`id` AND s_order.`ordernumber` = Dup.`ordernumber`
@maxout
maxout / Add2Cart_within_listing.tpl
Last active March 1, 2022 08:07
shopware 5 Add2Cart within listing
{if !$sArticle.sConfigurator && !$sArticle.variants && !$sArticle.sVariantArticle}
<a href="{url controller=checkout action=addArticle sAdd=$sArticle.ordernumber sQuantity=1}"
data-add-article="true"
data-showModal="false"
data-addArticleUrl="{url controller=checkout action=ajaxAddArticleCart sAdd=$sArticle.ordernumber sQuantity=1}"
data-text="{s name="ListingBoxLinkCart"}In den Warenkorb{/s}"
title="{s name="ListingBoxLinkCart"}In den Warenkorb{/s}"
class="product--action action--add tooltip">
@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
);
}
@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 / 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 / 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';