Skip to content

Commit

Permalink
fix(checkout): work with bbp and do6 from cdn
Browse files Browse the repository at this point in the history
  • Loading branch information
joerivanveen committed Apr 12, 2024
1 parent 6ed314d commit 5011cbe
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 612 deletions.
10 changes: 6 additions & 4 deletions Model/Quote/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ public function getDeliveryOptions(array $forAddress = []): array
private function getGeneralData()
{
return [
'allowRetry' => true,
//'allowRetry' => false,
'platform' => self::PLATFORM,
'carriers' => $this->getActiveCarriers(),
'currency' => $this->currency->getStore()->getCurrentCurrency()->getCode(),
'allowShowDeliveryDate' => $this->helper->getBoolConfig(Data::XML_PATH_GENERAL, 'date_settings/allow_show_delivery_date'),
//'carriers' => $this->getActiveCarriers(),
//'currency' => $this->currency->getStore()->getCurrentCurrency()->getCode(),
//'allowShowDeliveryDate' => $this->helper->getBoolConfig(Data::XML_PATH_GENERAL, 'date_settings/allow_show_delivery_date'),
'deliveryDaysWindow' => $this->helper->getIntegerConfig(Data::XML_PATH_GENERAL, 'date_settings/deliverydays_window'),
'dropOffDelay' => $this->getDropOffDelay(Data::XML_PATH_GENERAL, 'date_settings/dropoff_delay'),
'pickupLocationsDefaultView' => $this->helper->getCarrierConfig('shipping_methods/pickup_locations_view', Data::XML_PATH_GENERAL),
Expand Down Expand Up @@ -318,6 +318,8 @@ private function getDeliveryOptionsStrings(): array
'retry' => __('Again'),
'pickUpFrom' => __('Pick up from'),
'openingHours' => __('Opening hours'),
'showMoreHours' => __('Show more opening hours'),
'showMoreLocations' => __('Show more locations'),

'cityText' => __('City'),
'postalCodeText' => __('Postcode'),
Expand Down
4 changes: 4 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,16 @@
<label>Monday delivery</label>
<tooltip>Delivery on monday may require special conditions compared to other (week)days including but not limited to fee and cutoff time.</tooltip>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<depends>
<field id="active">1</field>
</depends>
</field>
<field id="monday_fee" translate="label comment" type="text" sortOrder="307" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Monday delivery fee</label>
<tooltip>This will be added to the regular shipping price</tooltip>
<depends>
<field id="monday_active">1</field>
<field id="active">1</field>
</depends>
</field>
<field id="signature_active" translate="label comment" type="select" sortOrder="310" showInDefault="1" showInWebsite="1" showInStore="1">
Expand Down
12 changes: 7 additions & 5 deletions etc/csp_whitelist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
<policies>
<policy id="script-src">
<policy id="style-src">
<values>
<value id="myparcel-frontend-vue-js" type="host">cdnjs.cloudflare.com</value>
<value id="myparcel-frontend-vue-css" type="host">cdn.jsdelivr.net</value>
</values>
</policy>
<policy id="style-src">
<policy id="script-src">
<values>
<value id="myparcel-frontend-vue-css" type="host">cdnjs.cloudflare.com</value>
<value id="myparcel-frontend-leaflet" type="host">cdnjs.cloudflare.com</value>
<value id="myparcel-frontend-vue-js" type="host">cdn.jsdelivr.net</value>
</values>
</policy>
<policy id="connect-src">
<values>
<value id="myparcel-api" type="host">api.myparcel.nl</value>
<value id="myparcel-frontend-leaflet-css" type="host">cdn.jsdelivr.net</value>
</values>
</policy>
<policy id="img-src">
Expand All @@ -27,4 +29,4 @@
</values>
</policy>
</policies>
</csp_whitelist>
</csp_whitelist>
2 changes: 2 additions & 0 deletions i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ The times will be visible when nothing is filled in,Les temps ne seront pas visi
"Enter an amount that is either positive or negative. For example, do you want to give a discount for using this function or do you want to charge extra for this delivery option.","Introduisez ici un montant positif ou négatif. Si vous souhaitez par exemple proposer une réduction pour cette fonction ou décompter des frais supplémentaires pour cette option de livraison."
Pick up from,Retrait à partir de
Opening hours,Heures d'ouverture
Show more opening hours,Montrer plus d'heures d'ouverture
Show more locations,Montrer plus d'emplacements
Closed,Fermé
Postcode,Code postal
House number,Numéro de rue
Expand Down
2 changes: 2 additions & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ The times will be visible when nothing is filled in,De tijden zullen zichtbaar z
"Enter an amount that is either positive or negative. For example, do you want to give a discount for using this function or do you want to charge extra for this delivery option.","Voer een bedrag in dat positief of negatief is. Wilt u bijvoorbeeld een korting geven voor het gebruik van deze functie of wilt u extra in rekening brengen voor deze leveringsoptie."
Pick up from,Ophalen vanaf
Opening hours,Openingstijden
Show more opening hours,Toon meer openingstijden
Show more locations,Toon meer locaties
Closed,Gesloten
Postcode,Postcode
House number,Huisnummer
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"postinstall": "node postinstall.js"
},
"dependencies": {
"@myparcel/delivery-options": "^6",
"custom-event-polyfill": "^1.0.7",
"object-path": "^0.11.5"
},
Expand Down
4 changes: 0 additions & 4 deletions postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ const vendor = path.resolve(__dirname, 'view/frontend/web/js/vendor');
const nodeModules = path.resolve(__dirname, 'node_modules');

const copy = [
[
`${nodeModules}/@myparcel/delivery-options/dist/myparcel.js`,
vendor,
],
[
`${nodeModules}/custom-event-polyfill/polyfill.js`,
`${vendor}/polyfill-custom-event.js`,
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/layout/checkout_index_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="https://unpkg.com/@myparcel/delivery-options@beta/dist/style.css"
<css src="https://cdn.jsdelivr.net/npm/@myparcel/delivery-options@6/dist/style.css"
src_type="url"
rel="stylesheet"
type="text/css" />
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var config = {
},
},
paths: {
myparcelDeliveryOptions: 'https://cdn.jsdelivr.net/npm/@myparcel/delivery-options@6/dist/myparcel',
leaflet: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.5.1/leaflet',
vue2leaflet: 'https://cdnjs.cloudflare.com/ajax/libs/Vue2Leaflet/1.0.2/vue2-leaflet.min',
},
};
Loading

0 comments on commit 5011cbe

Please sign in to comment.