【问题标题】:Insert article price in shipment.pdf Magento 1.9在 shipping.pdf 中插入商品价格 Magento 1.9
【发布时间】:2022-01-09 17:54:31
【问题描述】:

我无法在货件 pdf 中插入商品的售价

我添加

$page->drawText($item->getPrice(), $x + 5, $this->y, 'UTF-8');

但是,我没有含增值税的价格,而是不含增值税的价格 请问ttc价格或者总行怎么加?

【问题讨论】:

  • 没人帮我吗?
  • 尝试使用Mage::helper('tax')->getPrice($item->getProduct(), $item->getProduct()->getFinalPrice(),true);这样的税务助手

标签: pdf magento-1.9.1


【解决方案1】:

感谢您的帮助。这是当前代码: 如何调整到最后加上 ttc 价格?

        foreach ($shipment->getItemsCollection() as $item) {
        /**
         * @var Mage_Sales_Model_Order_Shipment_Item $item
         */
        $page->setFillColor(new Zend_Pdf_Color_GrayScale(0.85));
        $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
        $page->setLineWidth(0.5);
        $page->drawRectangle($x + 420, $this->y - 8, $page->getWidth() - 50, $this->y + 12);
        $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
        $page->drawRectangle(50, $this->y - 8, $page->getWidth() - 50, $this->y + 12, Zend_Pdf_Page::SHAPE_DRAW_STROKE);
        $page->drawLine($x + 70, $this->y + 12, $x + 70, $this->y - 8);
        $page->drawLine($x + 350, $this->y + 12, $x + 350, $this->y - 8);
        $page->drawLine($x + 420, $this->y + 12, $x + 420, $this->y - 8);
        $page->drawText($item->getSku(), $x + 5, $this->y, 'UTF-8');
        $page->drawText(strlen($item->getName()) > 50 ? substr($item->getName(), 0, 52) . "..." : $item->getName(), $x + 75, $this->y, 'UTF-8');

        $product = Mage::getModel('catalog/product')->load($item->getProductId());
        if ($product->getId()) {
            $size = $product->getAttributeText('size') ?: $product->getData('size_label');
            $page->drawText($size, $x + 355, $this->y, 'UTF-8');
        }
        $page->drawText('', $x + 425, $this->y, 'UTF-8');
        $this->y -= 20;
    }`**enter code here**`

【讨论】:

  • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-06-08
相关资源
最近更新 更多