首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >插入shipment.pdf Magento1.9中的商品价格

插入shipment.pdf Magento1.9中的商品价格
EN

Stack Overflow用户
提问于 2021-12-03 10:44:02
回答 1查看 48关注 0票数 0

我无法在装运的pdf中插入某一物品的售价。

我补充说

代码语言:javascript
复制
$page->drawText($item->getPrice(), $x + 5, $this->y, 'UTF-8');

但是,我没有包括增值税在内的价格,但不包括增值税的价格,如何增加ttc的价格或线路的总数?

EN

回答 1

Stack Overflow用户

发布于 2021-12-09 11:35:31

感谢这个help.here是当前的代码:如何调整它以增加ttc的最终价格?

代码语言:javascript
复制
        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**`
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70213032

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档