I'm having problem in adding category description to top navigation. I'm using custom extension magento extension (got it from http://web-experiment.info/webandpeople-custom-menu-extension.html)
So far i went to navigation.php file and changed
$html.= '<a class="itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . ' </span></a>' ;
To
$html.= '<a class="itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . $description . ' </span></a>' ;
but still i'm getting only category name.
You can get the complete code in http://puck.ro/Navigation.txt
I thought this is not the right way of doing this!!
Did anyone tell me the exact way of doing this?
Thanks in advance.
I used this to grab the descriptions
$category_data =Mage::getModel('catalog/category')->load($id);
$category_data_des = $category_data->getDescription();
then just added in the loop like so
$html[] = '<span>'.$category_data_des.'</span>';
Related
Thanks for the reaching out to my question, but i have got a problem, I'm trying to Import an excel file with multiple sheets.
Find sheets by some cell-value validation, like if on cell E7, i have a value, store this sheet as separate file. I'm doing mapping() for cell values, and then trying to use Excel::store to save each individual sheet separately. Can't receive any data for individual sheets
Also store the original file. This works!
The issue is, i can't receive any data for storing individual-sheets as excel files, i can create the individual excel files, but no data is being received, or maybe i'm not using the right data-format mentioned on documentation.
Please also check the code. Any help would be appreciated.
public function mapping(): array
{
return [
'altafit_id' => 'E7',
'year' => 'B3',
'initial_month' => 'B4',
'final_month' => 'B5',
];
}
public function model(array $row)
{
// dd($row);
$name = $row['altafit_id'];
$year = $row['year'];
$initial_month = $row['initial_month'];
$final_month = $row['final_month'];
$file_type = 'club';
// dd(collect((object) $row));
Excel::store(collect((object) $row), 'P&L_' . $name . '_' . $year . '_' . $initial_month . '_06' . ',clubs' . ',' . $initial_month . ',' . $final_month . '.' . 'xls', 'public');
return new Files([
//'user_id' => $row['user_id'],
'file_name' => 'P&L_' . $name . '_' . $year . '_' . $initial_month . '_06' . ',clubs' . ',' . $initial_month . ',' . $final_month . '.' . 'xls',
'file_type' => $file_type
]);
}
Already check the documentation, but doesn't work for me.
https://docs.laravel-excel.com/3.1/getting-started/
How to filter {ITEM_TITLE} and {ITEM_DESCRIPTION} osclass keywords before using them in emails?
I want to apply a function on the item_title and item_description before using them in emails.
Ex.
Title: Sell bmw_ x5__
To become
Sell bmw x5
without changing the database values
I have the function
removeunderline(argument) that works, I only need to know from where to call it or where to use it.
(Osclass forums are blocked for new users, that's why I ask here)
/oc-includes/osclass/emails.php
Put removeunderline() at {ITEM_TITLE} and {ITEM_DESCRIPTION} values.
Example:
$words = array();
$words[] = array(
'{ITEM_DESCRIPTION_ALL_LANGUAGES}',
'{ITEM_DESCRIPTION}',
'{ITEM_COUNTRY}',
'{ITEM_PRICE}',
'{ITEM_REGION}',
'{ITEM_CITY}',
'{ITEM_ID}',
'{USER_NAME}',
'{USER_EMAIL}',
'{ITEM_TITLE}',
'{ITEM_URL}',
'{ITEM_LINK}',
'{VALIDATION_LINK}',
'{VALIDATION_URL}',
'{EDIT_LINK}',
'{EDIT_URL}',
'{DELETE_LINK}',
'{DELETE_URL}'
);
$words[] = array(
$all,
removeunderline($item['s_description']), // here
$item['s_country'],
osc_format_price($item['i_price']),
$item['s_region'],
$item['s_city'],
$item['pk_i_id'],
$item['s_contact_name'],
$item['s_contact_email'],
removeunderline($item['s_title']), // here
$item_url,
$item_link,
'<a href="' . $validation_url . '" >' . $validation_url . '</a>',
$validation_url,
'' . $edit_url . '',
$edit_url,
'' . $delete_url . '',
$delete_url
);
Do the same for all {ITEM_TITLE} in this file (10 replacements).
Do the same for all {ITEM_DESCRIPTION} in this file (3 replacements).
I have a CSV file with name,area,city fieds and I'm expecting that CSV with following fields name,area,city,latitude,longitude
Can any one suggest which API is best for these,
I already tried
Google API's
Textsearch: this is giving overall city wise. Not particular
eg: kfc, in jp nagar 1st phase, bangalore it throws all over bangalore kfc list
I want exactly
echo $url = "https://maps.googleapis.com/maps/api/geocode/json?address=" . $name1 . "+" . $area1 . "+" . $city . "&key=" . $api_key;
Which API will fulfill my requirement?
I tried this also
$url = "https://maps.googleapis.com/maps/api/place/textsearch/json?query=". $name1 . "+" . $area1 . "+" . $city . "&key=" . $api_key;
Hi all I am Searching one product in search box but magneto will display Searching product as well as some other product. How to over come this issue??
You can change search options in the backend:
System -> Configuration -> Catalog -> Catalog Search
You can choose search type as 'Like', 'Fulltext' and 'Combine', which are explained in more detail here.
GO to the admin section System -> Configuration -> Catalog -> Catalog Search.
Select fulltext and save.
Then open file app/code/core/Mage/CatalogSearch/Model/resources/Fulltext.php
and make changes in the code as follows:
$likeCond = '(' . join(' OR ', $like) . ')';
to
$likeCond = '(' . join(' AND', $like) . ')';
&
$where .= ($where ? ' OR ' : '') . $likeCond;
to
$where .= ($where ? ' AND ' : '') . $likeCond;
Is there a way to adjust the size of gorcery CRUD's list thumbnails?
The way it is now it's just silly big, and breaks the table flow.
If possible, it would be nice to have a PHP solution or grocery CRUD setting for this; if not - a CSS rule would be ok, I guess.
Same issue I came across, I'm sure it's a quick-and-dirty solution but it worked for me.
Open your application/library/Grocery_CRUD.php
Download timthumb from here
Place timthumb.php in Root directory (in same directory
level cache folder should be there)
Find function change_list_value
Find around line number 333 in Grocery_CRUD.php
$file_url_anchor .= 'class="image-thumbnail">';
Replace with... following
$file_url_anchor .= ' class="image-thumbnail"><img src="' . base_url('timthumb.php') . '?src=' . $file_url . '&w=100&h=100&zc=3' .'" height="50px">';
Again Find function get_upload_file_input
Find around line number 2545 in Grocery_CRUD.php
$input .= $is_image ? " $image_class'>" : "' target='_blank'>$value";
Replace with following
$input .= $is_image ? " $image_class'><img src='".base_url('timthumb.php') . '?src=' . $file_url . '&w=100&h=100&zc=3'."' height='50px'>" : "' target='_blank'>$value";
Hope this would help you to get rid of ugly size in your list as well as add/edit forms