Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Resolving this @todo:
/**
* {@inheritdoc}
*/
public function isVisible() {
// @todo Check that the order contains at least one shippable entity.
return $this->order->hasField('shipments');
}
Comment | File | Size | Author |
---|---|---|---|
#5 | commerce_shipping-hide-shipping-info-pane-2854495-5.patch | 1.11 KB | jsacksick |
Comments
Comment #2
iajay CreditAttribution: iajay commentedIs this possible currently?
Comment #3
bojanz CreditAttribution: bojanz at Centarro commentedNo, hence the open issue.
Comment #4
rakesh.gectcr@Bojanz Need a direction,
Trying to check the product variation is "shippable" or not. Don't know whether it is a right direction or not. Any way struck on loading respective traits (PurchasableEntityShippable) on the product variant.:(
Comment #5
jsacksick CreditAttribution: jsacksick at Centarro commentedComment #7
bojanz CreditAttribution: bojanz at Centarro commentedThanks, jsacksick!
Comment #8
shabana.navas CreditAttribution: shabana.navas commentedI believe there is a little mistake in this patch. If you look, it is returning FALSE by default, so instead of:
it SHOULD be:
because we're doing a check for "if shipment should be visible" right. New patch has been added.
Comment #9
bojanz CreditAttribution: bojanz at Centarro commentedLooks like you misunderstood the code.
From your patch:
The current code hides the pane if the order has no "shipments" field (== isn't shippable).
Your change hides the pane if the order has a shipments field (== is shippable). That doesn't make sense :)
Comment #10
shabana.navas CreditAttribution: shabana.navas commentedMy apologies, yeah, I guess, I did misunderstand the check.