我在prestashop上有一个多线圈环境。如果邮政编码不正确,我创建了一个带控制器的模块来更改商店。当我使用Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim CustNumber As String
Dim CustName As String
Dim CompanyName As String
Dim CustPhoneNumb As String
Dim i As Long
CustNumber = Worksheets("OrderInvoice").Range("C10").Value
Sheets("CustomerList").Select
FoundDatails = False
i = 1
For i = 1 To 100
Cells(i, 1).Select
If CustNumber = Trim(Cells(i, 1)) Then
CustName = Trim(Cells(i, 2))
CompanyName = Trim(Cells(i, 3))
CustPhoneNumb = Trim(Cells(i, 4))
FoundDatails = True
Exit For
Else
i = i
End If
Next
Sheets("OrderInvoice").Select
Range("C11:F11") = CustName
Range("I11:J11") = CustPhoneNumb
Range("C12:J12") = CompanyName
End Sub
重定向到我当前的商店时,问题出现了,我需要它重定向到另一个商店。这是我的代码:
{{1}}
我在代码中作了一些澄清作为评论。问题是,我该如何更改活动商店?
答案 0 :(得分:0)
我找到了自己的答案。而不是在$testShop = Context::getContext()->shop;
将该行更改为:
$testShop = new Shop($id_shop);
$testShop->getContext();
一切都很好。谢谢!