コード例 #1
0
 /**
  * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
  *
  * @return string
  */
 public function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
 {
     //passcode to append for url
     $passcode = $this->dataHelper->getPasscode();
     //last quote id for dynamic page
     $lastQuoteId = $this->dataHelper->getLastQuoteId();
     if (empty($passcode)) {
         $passcode = '[PLEASE SET UP A PASSCODE]';
     }
     //alert message for last order id is not mapped
     if (!$lastQuoteId) {
         $lastQuoteId = '[PLEASE MAP THE LAST QUOTE ID]';
     }
     //generate the base url and display for default store id
     $baseUrl = $this->dataHelper->generateDynamicUrl();
     $text = sprintf('%sconnector/quoteproducts/upsell/code/%s/quote_id/@%s@', $baseUrl, $passcode, $lastQuoteId);
     $element->setData('value', $text);
     return parent::_getElementHtml($element);
 }
コード例 #2
0
 /**
  * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
  *
  * @return string
  */
 public function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
 {
     //base url for dynamic content
     $baseUrl = $this->dataHelper->generateDynamicUrl();
     $passcode = $this->dataHelper->getPasscode();
     //last quote id for dynamic page
     $lastQuoteId = $this->dataHelper->getLastQuoteId();
     //config passcode
     if (empty($passcode)) {
         $passcode = '[PLEASE SET UP A PASSCODE]';
     }
     //alert message for last order id is not mapped
     if (!$lastQuoteId) {
         $lastQuoteId = '[PLEASE MAP THE LAST QUOTE ID]';
     }
     // full url
     $text = sprintf('%sconnector/email/basket/code/%s/quote_id/@%s@', $baseUrl, $passcode, $lastQuoteId);
     $element->setData('value', $text);
     return parent::_getElementHtml($element);
 }