I'm using an add Print order button to print a customer's order (not invoice) and I can't figure out how to get the logo to show up on the pdf. The following is the code that is in the extension but I can't find the function to manipulate it and I don't understand why it's not pulling the logo that I have in configuration. Please advise. :)
$this->insertLogo($page, $order->getStore());
You probably don't have store logo for PDF set. In admin you should go to
System -> Configuration -> Sales -> Sales -> Invoice and Packing Slip Design
and set your logo there.
Now for the logn explanation in case the above won't work :)
insertLogo function is located in class Mage_Sales_Model_Order_Pdf_Abstract (I asume that your class derives from it).
The rows that you should note are $image = Mage::getStoreConfig('sales/identity/logo', $store); and $image = Mage::getBaseDir('media') . '/sales/store/logo/' . $image;
getStoreConfig function is looking for the name of logo image in core_config_data table. You can check if the value is set with
SELECT * FROM core_config_data WHERE path = 'sales/identity/logo'
If the query won't return anything or will return value that is not an image name then you'll have to set that value first.
If that value is set you should have a look in
/your_store_root_dir/media/sales/store/logo/value_that_is_in_the_database
to see if the store logo image realy exists and if it doesn't add it there.
Did you check code in that class ($this) and/or its parent class? You'll see function inserLogo there.
Related
I need to put profile pic and cover photo on left block in member index I have try every single method but useless
So any help please
Actually phpfox 4.7
Please admins don't close the post I really need help with this tutorial
Here is a screenshots
https://i.stack.imgur.com/TewzF.jpg
https://i.stack.imgur.com/yI0FG.jpg
Go to AdminCP - Appearance - Blocks - Add Block
Now Fill the form as below
Product = Core
Module = Profile
Title = Anything(wont display public)
Type = PHP Block File
Page = Member Home Page (core. index-member)
Component = header (for cover photo), logo (for logo)
Placement View Sample Layout = Block 1 (This will place the image on left block
I'm trying to import images in the magento importer but nothings appearing. I've gone through all the threads and I'm sure I've done everything I'm supposed to do and now I'm at a complete loss for what the problem could be.
I've created a folder called "import" in my "media" folder and placed the image 'blog-1.jpg' in it and my data is saved in a .csv and it looks similar to this: (i've copied the entries manually for readability)
sku - test1
name - test1
description - Test
short_description - Test
status - 1
visibility - 4
tax_class - 2
qty - 1
price - 1
weight - 1
image - /blog-1.jpg
image_label - Hello
small_image - /blog-1.jpg
small_image_label - Hello
thumbnail - /blog-1.jpg
thumbnail_label - Hello
When I "check" my data it says the data is fine and its found a field. Everything else gets imported correctly but when I click on "images" it has no images in there.
First of all your image are store in media>import folder.
Then in your csv file just write in image column /imagename.jpg
It will find same imagename in import folder if image exist then it will upload the image.
I'm sorry to say, but there is more going on behind the scenes with magento images that it simply putting a filename in the database and linking to your image. The cache generation alone is pretty complex. I believe you are going to have a hard time doing it the way you are attempting.
That being said, I do have a suggestion. Since your images are already on the server, I suggest you write a simple php script to tell magento to attach them to the product image. This could be automated, but i'll give you a small example below...
To attach an image, you would simply navigate to the url like this http://yoursite.com/imageattacher.php?sku=YOURSKU&image=yourimagefilename.jpg
The script would be like this... create a file in your magento ROOT and call it imageattacher.php. Upload your images to the magento media import directory. I have not tested this but it should work.
<?php
// Initialize magento for use outside of core
umask(0);
require_once 'app/Mage.php';
Mage::app('admin');
// Get the variables from the URL
$sku = $_GET["sku"];
$imageName = $_GET["image"];
// get the image from the import dir
$import = Mage::getBaseDir('media') . DS . 'import/' . $imageName;
// Load the product by sku
$product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
// if the product exists, attempt to add the image to it for all three items
if ($product->getId() > 0)
{
// Add the images and set them for their respective usage (the radio button in admin)
$product->addImageToMediaGallery($import,array('image', 'small_image', 'thumbnail'),false,false);
// Make the changes stick
$product->save();
}
?>
I have taken over a site and am looking for some assistance.
The site currently detects if a product has a scene7 image set associated to it, and then adds IS to the code to display the image set.
I am trying to do this for category image as well, if I hardcode _IS (product sku + _ID) the image set is loaded nicely, but obviously any product sku with no image set, the image doesn't load.
This is the code with the _IS hardcoded:
flyoutViewer.setAsset("/${catalogEntryDetails.partNumber}_IS");
This snippet of code detects whether there is a set or not:
var asset = '/' + wc.render.getContextById('ItemDetailsContext').properties.partNumber;
if (data['catalogRecord.exists'] == 1) {
asset += 'IS';
}
Am I missing something major? My guess I am, I can dig out more code if necessary.
Help would be appreciated?!
I have been trying to import products into Magento and images. The products are being imported and created properly but the images to not get imported.
I am aware of the basics of importing as I have done it in the past but cannot figure out what the issue is and what to do next.
some notes how and what I did:
I am aware to add a "/" before the image name
image name is case sensitive
upload images in media/import folder
media folder to be 777
Tried different folders like var/import or
media/catalog/product/import
Removed the .htcaccess file in media
Flushed cache
when i upload manually an image on a product it does show up properly
i tried specifying the _media_attribute_id in a column as 88 maybe
that should help but it didn't
If you have a Mage_Catalog_Model_Product, all you need to do is this:
$fn = '/absolute/path/to/image.jpg';
$types = array('thumbnail', 'small_image', 'image'); // or null if you already have the product's thumbnail, small image, and image set
$move = true; // move the source file, don't leave it sitting around
$exclude = false; // enabled in product view
$label = 'Turquoise';
$product->addImageToMediaGallery($fn, $types, $move, $exclude); // Strictly speaking, only the first parameter is required
if(!empty($label)) {
$gallery = $product->getData('media_gallery');
$gallery_img = array_pop($gallery);
$gallery_img['label'] = $label;
array_push($gallery['images'], $gallery_img);
$product->setData('media_gallery', $gallery);
}
$product->save();
I have faced the same problem while uploading product image. And i tested many methods to figure that out. But nothing helped me. At last in one of the tutorial I have seen that the image name and the sku name has to be same. with the extension of file extension. So i followed it and by God's grace it worked. You may try that also. It worked for me. I had spent almost one full day to figure that out.
In the shoppin cart; "checkout/cart.phtml" page, I want to add a column that contains a custom attribute. Working with a multilingual Website, I have to show the translated label of each Store.
I have tried this code:
$attributeLabel = Mage::getResourceModel('eav/entity_attribute_collection')
->setCodeFilter('length')
->getFirstItem()
->getFrontend_label();
echo "<pre>"; var_dump($attributeLabel); echo "</pre>";
but this shows the attribute admin label.
How can I get the translated labels for earch store ?
Thanks.
you will need to get the resource. Simply pull it from the product (or from the resource model). Then get the Attribute Object and instead of getting the frontend label you will need to get the store label.
$_product->getResource()->getAttribute('attributecode')->getStoreLabel();
alternatively
Mage::getModel('catalog/resource_product')->getAttribute($_attribute)->getStoreLabel();
also IMPORTANT: your attribute needs to have a Value Configured for that Language. (this is what got me here ;) )
getFrontendLabel() or getData('frontend_label'). You're confusing syntaxes.