Skip to content

Commit

Permalink
Merge branch '3.2' into 4.0
Browse files Browse the repository at this point in the history
* 3.2:
  [Pimcore] introduce LocalizedFallbackHelper
  [Payum] 2.6 compatibility
  [Translations] add missing translations
  • Loading branch information
dpfaffenbauer committed Oct 4, 2024
2 parents f1dfd9c + 59b58ee commit 3c5e773
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/CoreShop/Behat/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ services:
- '@CoreShop\Behat\Service\CookieSetterInterface'

payum.concurrency_gateway_factory:
class: Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder
class: Payum\Bundle\PayumBundle\Builder\GatewayFactoryBuilder
arguments: [ CoreShop\Behat\Service\Payum\Concurrency\ConcurrencyGatewayFactory ]
tags:
- { name: payum.gateway_factory_builder, factory: concurrency }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ coreshop.ui.error.voucher.invalid: 'Der angegebene Gutscheincode ist ungültig'
coreshop.ui.success.voucher.stored: 'Gutscheincode wurde erfolgreich angewendet'
coreshop.ui.success.voucher.successfully_removed: 'Gutscheincode wurde erfolgreich ausgetragen'
coreshop.ui.voucher.code: 'Gutscheincode'
coreshop.ui.voucher.apply_code: 'Einlösen'
coreshop.ui.discount_incl: 'Rabatt (inkl. MwSt.)'
coreshop.ui.discount_excl: 'Rabatt (exkl. MwSt.)'
coreshop.ui.surcharge_incl: 'Zuschlag (inkl. MwSt.)'
Expand Down Expand Up @@ -230,3 +229,22 @@ coreshop.cart_price_rule_voucher_generator.length.not_blank: 'Bitte geben Sie ei
coreshop.cart_price_rule_voucher_generator.length.range: 'Der Gutscheincode muss mindestens {{ min }} und maximal {{ max }} Zeichen lang sein.'
coreshop.cart_price_rule_voucher_generator.possible_generation_amount: 'Ungültige Gutscheincodelänge oder ungültiger Gutscheinbetrag. Es ist nicht möglich %expectedAmount% einzigartige Gutscheincodes mit einer Länge von %codeLength% Zeichen zu generieren. Es können maximal %possibleAmount% Gutscheincodes generiert werden.'
coreshop.cart_item.quantity.min: 'Die Menge eines Produktes im Warenkorb kann nicht kleiner als 1 sein.'
coreshop.ui.password_reset_request_success: 'Ein Link zum Zurücksetzen Ihres Passworts wurde an Ihre E-Mail-Adresse gesendet.'
coreshop.ui.password_reset_success: 'Ihr Passwort wurde erfolgreich zurückgesetzt.'
coreshop.ui.quote_empty: 'Ihre Angebotsanfrage ist leer'
coreshop.ui.payment_method: 'Zahlungsmethode'
coreshop.ui.email_address: 'E-Mail-Adresse'
coreshop.ui.shipping_method: 'Versandmethode'
coreshop.ui.brand: 'Marke'
coreshop.ui.out_of_stock: 'Nicht auf Lager'
coreshop.ui.no_description_available: 'Keine Beschreibung verfügbar'
coreshop.ui.no_address_found: 'Keine Adresse gefunden'
coreshop.ui.order_empty: 'Ihre Bestellung ist leer'
coreshop.ui.reset: 'Zurücksetzen'
coreshop.ui.voucher.apply_code: 'Gutscheincode anwenden'
coreshop.ui.copied: 'Kopiert'
coreshop.ui.copy: 'Kopieren'
coreshop.ui.excl_tax: 'Exkl. Steuer'
coreshop.ui.inc_tax: 'Inkl. Steuer'
coreshop.ui.invoice_number: 'Rechnungsnummer'
coreshop.ui.delivery_date_invoice_date_info: 'Datum'
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,22 @@ coreshop.cart_price_rule_voucher_generator.length.not_blank: 'Please enter coupo
coreshop.cart_price_rule_voucher_generator.length.range: 'Coupon must be at least {{ min }} and at most {{ max }} characters long.'
coreshop.cart_price_rule_voucher_generator.possible_generation_amount: 'Invalid coupons code length or coupons amount. It is not possible to generate %expectedAmount% unique coupons with code length %codeLength%. The possible amount to generate is %possibleAmount%.'
coreshop.cart_item.quantity.min: 'Quantity of an order item cannot be lower than 1.'
coreshop.ui.password_reset_request_success: 'An email has been sent to you with further instructions.'
coreshop.ui.password_reset_success: 'Your password has been successfully reset.'
coreshop.ui.quote_empty: 'Your quote is empty'
coreshop.ui.payment_method: 'Payment Method'
coreshop.ui.email_address: 'Email Address'
coreshop.ui.shipping_method: 'Shipping Method'
coreshop.ui.brand: 'Brand'
coreshop.ui.out_of_stock: 'Out of Stock'
coreshop.ui.no_description_available: 'No description available'
coreshop.ui.no_address_found: 'No address found'
coreshop.ui.order_empty: 'Your order is empty'
coreshop.ui.reset: 'Reset'
coreshop.ui.voucher.apply_code: 'Apply Voucher'
coreshop.ui.copied: 'Copied'
coreshop.ui.copy: 'Copy'
coreshop.ui.excl_tax: 'Excl. Tax'
coreshop.ui.inc_tax: 'Inc. Tax'
coreshop.ui.invoice_number: 'Invoice Number'
coreshop.ui.delivery_date_invoice_date_info: 'Date'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends '@CoreShopFrontend/layout.html.twig' %}

{% block title %}
{% block checkout_title %}{% endblock %} | {{ 'checkout'|trans }}
{% block checkout_title %}{% endblock %} | {{ 'coreshop.ui.checkout'|trans }}
{% endblock %}

{% block content %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends '@CoreShopFrontend/layout.html.twig' %}

{% block title %}
{% block checkout_title %}{% endblock %} | {{ 'checkout'|trans }}
{% block checkout_title %}{% endblock %} | {{ 'coreshop.ui.checkout'|trans }}
{% endblock %}

{% block content %}
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/PayumBundle/CoreGatewayFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
namespace CoreShop\Bundle\PayumBundle;

use Http\Adapter\Guzzle7\Client;
use Payum\Bundle\PayumBundle\ContainerAwareCoreGatewayFactory;
use Payum\Core\Bridge\Spl\ArrayObject;
use Payum\Core\Bridge\Symfony\ContainerAwareCoreGatewayFactory;

class CoreGatewayFactory extends ContainerAwareCoreGatewayFactory
{
Expand Down
19 changes: 14 additions & 5 deletions src/CoreShop/Bundle/PayumBundle/CoreGatewayFactoryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@

namespace CoreShop\Bundle\PayumBundle;

class CoreGatewayFactoryBuilder extends \Payum\Core\Bridge\Symfony\Builder\CoreGatewayFactoryBuilder
use Payum\Bundle\PayumBundle\ContainerAwareCoreGatewayFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;

class CoreGatewayFactoryBuilder extends \Payum\Bundle\PayumBundle\Builder\CoreGatewayFactoryBuilder
{
public function build(array $defaultConfig): CoreGatewayFactory
private ContainerInterface $container;

public function __construct(ContainerInterface $container)
{
$coreGatewayFactory = new CoreGatewayFactory($defaultConfig);
$coreGatewayFactory->setContainer($this->container);
parent::__construct($container);

return $coreGatewayFactory;
$this->container = $container;
}

public function build(array $defaultConfig): ContainerAwareCoreGatewayFactory
{
return new ContainerAwareCoreGatewayFactory($this->container, $defaultConfig);
}
}
4 changes: 2 additions & 2 deletions src/CoreShop/Bundle/PayumBundle/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ services:

CoreShop\Bundle\PayumBundle\CoreGatewayFactoryBuilder:
decorates: 'payum.core_gateway_factory_builder'
calls:
- [setContainer, ['@service_container']]
arguments:
- '@service_container'
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);

/*
* CoreShop
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - CoreShop Commercial License (CCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) CoreShop GmbH (https://www.coreshop.org)
* @license https://www.coreshop.org/license GPLv3 and CCL
*
*/

namespace CoreShop\Component\Pimcore\DataObject;

use Pimcore\Model\DataObject\Localizedfield;

class LocalizedFallbackHelper
{
/**
* @return mixed
*/
public static function useFallback(\Closure $function, bool $use = false): mixed
{
$backup = Localizedfield::getGetFallbackValues();

Localizedfield::setGetFallbackValues($use);

$result = $function();

Localizedfield::setGetFallbackValues($backup);

return $result;
}
}

0 comments on commit 3c5e773

Please sign in to comment.