feat: allow product selection on discounts allocated to a specific item (#395)
This commit is contained in:
@@ -106,7 +106,13 @@ class WebshipperFulfillmentService extends FulfillmentService {
|
||||
|
||||
const fromOrder = await this.orderService_.retrieve(orderId, {
|
||||
select: ["total"],
|
||||
relations: ["discounts", "shipping_address", "returns"],
|
||||
relations: [
|
||||
"discounts",
|
||||
"discounts.rule",
|
||||
"discounts.rule.valid_for",
|
||||
"shipping_address",
|
||||
"returns",
|
||||
],
|
||||
})
|
||||
|
||||
const methodData = returnOrder.shipping_method.data
|
||||
@@ -286,10 +292,11 @@ class WebshipperFulfillmentService extends FulfillmentService {
|
||||
)) &&
|
||||
this.invoiceGenerator_.createCertificateOfOrigin
|
||||
) {
|
||||
const base64Coo = await this.invoiceGenerator_.createCertificateOfOrigin(
|
||||
fromOrder,
|
||||
fulfillmentItems
|
||||
)
|
||||
const base64Coo =
|
||||
await this.invoiceGenerator_.createCertificateOfOrigin(
|
||||
fromOrder,
|
||||
fulfillmentItems
|
||||
)
|
||||
|
||||
certificateOfOrigin = await this.client_.documents
|
||||
.create({
|
||||
@@ -419,9 +426,8 @@ class WebshipperFulfillmentService extends FulfillmentService {
|
||||
url: l.url,
|
||||
tracking_number: l.number,
|
||||
}))
|
||||
const [orderId, fulfillmentIndex] = wsOrder.data.attributes.ext_ref.split(
|
||||
"."
|
||||
)
|
||||
const [orderId, fulfillmentIndex] =
|
||||
wsOrder.data.attributes.ext_ref.split(".")
|
||||
|
||||
if (orderId.charAt(0).toLowerCase() === "s") {
|
||||
if (fulfillmentIndex.startsWith("ful")) {
|
||||
|
||||
Reference in New Issue
Block a user