得到它的工作......感谢您的帮助,还有一些工作要做,但它在正确的时间调用脚本!谢谢
事件.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="catalog_controller_product_init_after">
<observer name="Apicall" instance="Olisco\Tpcconnector\Observer\ApiCall" />
</event>
</config>
<?php
namespace Olisco\Tpcconnector\Observer;
use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;
class ApiCall implements ObserverInterface
{
public function execute(EventObserver $observer)
{
#Code here to execute!
}
}