Skip to content

Commit

Permalink
Allow to set a config object to easier extend the pickup point manager
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed May 10, 2024
1 parent 1127fb1 commit e41c946
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Resources/views/shop/_javascripts.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<script type="module">
import { PickupPointManager } from '{{ asset('bundles/setonosyliusshipmondoplugin/js/pickup-point-manager.js') }}';
const manager = new PickupPointManager({
const pickupPointManagerConfig = pickupPointManagerConfig || {};
const manager = new PickupPointManager(Object.assign({
endpoint: '{{ path('setono_sylius_shipmondo_shop_ajax_get_pickup_points') }}',
allowedShippingMethods: {{ sss_shipping_methods_with_pickup_point_delivery()|json_encode|raw }}
});
}, pickupPointManagerConfig));
manager.init();
</script>
{% endif %}

0 comments on commit e41c946

Please sign in to comment.