I have added a function in "ProductEditController" from merchello.controller.js (Merchello.FastTrack.Ui\App_Plugins\Merchello\js). Please look for the code below:
In the file "Merchello.FastTrack.Ui\App_Plugins\Merchello\Backoffice\Merchello\directives\productvariant.mainproperties.tpl.html". I add a button to call the function "changeMicrosoftOffer" like this:
<div>
<div>
<label for="changeOffer" style="font-weight: bold;">Change Microsoft Offer</label>
<a data-ng-click="changeMicrosoftOffer()">Change Microsoft Offer</a>
</div>
</div>
When I click the button "Check Microsoft Offer", It does nothing. But when I click OpenCopyProductDialog button, it can open a dialog. How can the OpenCopyProductDialog does effect, but my ChangeMicrosofOffer button doesn't effect on the function? Event they all call the functions inside "ProductEditController". I don't get it, please help me!
In order for that to work you would need to add the "getOfferCatalog" method in the offerResource factory and then call a method on the OfferApiController which would do whatever it is you are trying to do.
It would be better to do this thing as a directive so that you can keep your code outside of Merchello's core scripts.
It would work the same and you would have all of your code (and your own ApiController).
I have my own Api Controller. Let say if I have a function changeMicrosoftOffer in 'merchello.directives', then it works. Because when it direct to view "productVariantMainProperties", it enable $scope.function to any call from the view.
How to call a function on "ProductEditController"?
Hello,
I have added a function in "ProductEditController" from merchello.controller.js (Merchello.FastTrack.Ui\App_Plugins\Merchello\js). Please look for the code below:
The new function name is changeMicrosoftOffer.
In the file "Merchello.FastTrack.Ui\App_Plugins\Merchello\Backoffice\Merchello\directives\productvariant.mainproperties.tpl.html". I add a button to call the function "changeMicrosoftOffer" like this:
When I click the button "Check Microsoft Offer", It does nothing. But when I click OpenCopyProductDialog button, it can open a dialog. How can the OpenCopyProductDialog does effect, but my ChangeMicrosofOffer button doesn't effect on the function? Event they all call the functions inside "ProductEditController". I don't get it, please help me!
In order for that to work you would need to add the "getOfferCatalog" method in the offerResource factory and then call a method on the OfferApiController which would do whatever it is you are trying to do.
It would be better to do this thing as a directive so that you can keep your code outside of Merchello's core scripts.
It would work the same and you would have all of your code (and your own ApiController).
I have my own Api Controller. Let say if I have a function changeMicrosoftOffer in 'merchello.directives', then it works. Because when it direct to view "productVariantMainProperties", it enable $scope.function to any call from the view.
is working on a reply...