symfony - Best way to add a method to Sylius Model -


for custom shipping calculator require access products in cart. method sylius\component\shipping\model\shipment::getshippables() gives me acces unique items, need know how many of each of them have been ordered.

i'd implement method getsingleshippables() not filter out duplicates.

what best way implement this? have overwrite shipment model explained in overriding models implement custom shipment class or there simpler way this? don't need change model, add 'getter method'.

there no easier way of doing it, have follow instructions in 'overriding models' => extend sylius class, add method, , set model new class in config.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -