Skip to content

Commit

Permalink
Merge pull request #3536 from plentymarkets/fix/requested_url
Browse files Browse the repository at this point in the history
remove parameters from requestedVariationUrl
  • Loading branch information
maxiroellplenty authored Apr 11, 2024
2 parents 82dc97f + 2e74bfb commit d6b1fd8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions meta/documents/changelog_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Im Zuge dieses Fixes wurde eine [MIME-Type libary](https://www.npmjs.com/package/mime-types) eingebunden.
- Die Einstellung: **Hake die Artikelinformationen an, die du in der Warenkorbvorschau anzeigen möchtest.** im plentyShop Assistenten Schritt **Angezeigte Informationen** hatte keine Auswirkung auf die angezeigten Informationen. Dies wurde behoben.
- Durch das Fixieren des Headers zum Verbessern der CLS-Werte kam es unter Umständen zu einem ungewünschten Scroll-Verhalten beim Browsen des Shops. Dies wurde behoben.
- Die Variable "requestedVariationUrl" gibt nun die URL ohne Query-Parameter zurück.

### Geändert

Expand Down
1 change: 1 addition & 0 deletions meta/documents/changelog_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- As part of this fix, a [MIME-Type libary](https://www.npmjs.com/package/mime-types) was integrated.
- The setting: **Check the boxes of the item information you want to display in the shopping cart preview** in the plentyShop assistant step **Displayed information** had no effect on the information displayed. This has been fixed.
- Fixing the header to improve CLS values sometimes caused undesired scroll behaviour when browing the shop. This has been fixed.
- The variable "requestedVariationUrl" now returns the URL without query parameters.

### Changed

Expand Down
9 changes: 5 additions & 4 deletions src/Contexts/SingleItemContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace Ceres\Contexts;

use IO\Helper\Utils;
use IO\Helper\ContextInterface;
use IO\Helper\Utils;
use IO\Services\CategoryService;
use IO\Services\CustomerService;
use Plenty\Modules\Category\Models\Category;
use Plenty\Modules\Webshop\Contracts\ContactRepositoryContract;
use Plenty\Modules\Webshop\Helpers\UrlQuery;
use Plenty\Plugin\ConfigRepository;
use Plenty\Modules\Webshop\Contracts\ContactRepositoryContract;
use Plenty\Modules\Category\Models\Category;

/**
* Class SingleItemContext
Expand Down Expand Up @@ -312,7 +312,8 @@ public function init($params)
$this->setAttributeMap = $params['setAttributeMap'];
/** @var UrlQuery $urlQuery */
$urlQuery = pluginApp(UrlQuery::class, ['path' => $this->request->getRequestUri(), 'lang' => Utils::getLang()]);
$this->requestedVariationUrl = $urlQuery->toAbsoluteUrl(Utils::getLang() !== $this->webstoreConfig->defaultLanguage);
$urlWithParameters = $urlQuery->toAbsoluteUrl(Utils::getLang() !== $this->webstoreConfig->defaultLanguage);
$this->requestedVariationUrl = explode("?", $urlWithParameters)[0] ?? '';
$defaultCategoryId = 0;
$plentyId = Utils::getPlentyId();
foreach ($this->item['documents'][0]['data']['defaultCategories'] as $category) {
Expand Down

0 comments on commit d6b1fd8

Please sign in to comment.