I have problem in wishlist
I need to move products from wishlist to enquiry quote
$url = Mage::getUrl('qquoteadv/index/addItem/');
$actionQuote = "addQuote('".$url."');"
i tried above code but its not working
any suggestion for this query?
I don't know Magento, but I think addQuote is function, so it should be
$actionQuote = addQuote($url);
qquoteadv is the name of the Magento Cart2Quote extension, so that url won't work if you don't have it installed.
Also, your url is missing the product id:
qquoteadv/index/addItem/ should be qquoteadv/index/addItem/product/123/ for example. And it only add's one product.
You could call this url multiple times using ajax, then the url should be qquoteadv/index/addItemAjax/product/123/ that way you could add the whole wishlist to the quote.
Related
The b2bking plugin has helped me alot with my shop. One of its features in that it can display both a wholesale and a retail price.
My problem is that we are a swedish shop and I would like it to say "ÅF-pris" and "RRP" instead of what is outputs by default.
I've tried modifying the code inside the plugin. It works but I know that it will stop working as soon as I update the plugin. This is why I want to do it with filter hooks provided by the plugin.
What I've tried (I am kinda new to PHP)
add_filter('b2bking_filter_wholesale_price_final', 'alex_translate_price_text');
function alex_translate_price_text($text_retail_price, $text_final_price){
$text_retail_price = 'test_RRP: ';
return $text_retail_price;
$text_final_price = 'test_åf-pris: ';
return $text_final_price;
}
in the plugin, hook looks like this:
$price = apply_filters('b2bking_filter_wholesale_price_final', $price, $text_retail_price, $retail_price, $text_final_price, $b2b_price_price, $product_id);
My thought process is that I want to change the variables "$text_retail_price" and "$text_final_price" to "ÅF-pris" and "RRP" as right now they contain "Retail price" and "Wholesale price".
We're the developers of the plugin, glad to hear it's been useful to you,
There's now a setting where you can change these directly via B2BKing -> Settings -> Language & Text.
I have little difficulties, I have admin order with Prestashop version 1.7.6, in the admin order as Prestashop rules that the reference code for the products with the combination is coming through product options but I want to show instead of that reference what is the regular reference code of the product like its coming for the product who have not product options.
I know where is the combination reference code into the admin end if I will change it will work like regular but there are 900+ products so I just want to make it correct with code.
reference with the combination:
Regular product reference:
into the admin where I want to change
And here is the code of the admin order:
file path : localhost/pre7/admin231nuevxm/themes/default/template/controllers/orders/_product_line.tpl
<a href="{$link->getAdminLink('AdminProducts', true, ['id_product' => $product['product_id']|intval, 'updateproduct' => '1'])|escape:'html':'UTF-8'}">
<span class="productName">{$product['product_name']}</span><br />
{if $product.product_reference}{l s='Reference number:' d='Admin.Orderscustomers.Feature'} {$product.product_reference}<br />{/if}
{if $product.product_supplier_reference}{l s='Supplier reference:' d='Admin.Orderscustomers.Feature'} {$product.product_supplier_reference}{/if}
</a>
{$product.product_reference} is the variable. I want to make it a regular reference. unfortunately, it's same for regular and combination
I have tried regular reference code {$product->reference} into the product page and its working fine there but not working into the admin order.
Ok I have solved this myself finally define an array in correct way {$product['reference']}
Thanks
I got a problem with my whislist. Here is the thing.
I try to programmatically add into a whistlist, a new Item.
So I use the $whishlist->addNewItem() function. The product is added, but if I had other products in my whislist, they've been removed!
Here is what I use:
<?php
$customer = Mage::getModel('customer/customer')->load($my_customer_id);
$product = Mage::getModel('catalog/product')->load($my_product_id);
$wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer, true);
$request = new Varien_Object(array());
$result = $wishlist->addNewItem($product, $request);
$wishlist->save();
?>
Did I do something wrong?
Thank you guys
EDIT:
I Finally found, it seems weird, but in my case, I have to remove this line $wishlist->save();
I had to remove this line $wishlist->save();
I don't know if it's THE solution, but it works for me.
Thank's to everyone :)
Remove the ->save on the wishlist. Sometimes it works
This might help you,
Lets say you have to add a product to wishlist on click so it would be like :
<a onclick="setLocation('<?php echo $this->helper('wishlist')->getAddUrl(Mage::registry('current_product'));?>')">add to wishlist</a>
I too had the same problem. But in my case product visibility in magento backend is set to "Not Visible Individually". changed product visibility and it worked.
I had the same problem and the "save" function was not in cause.
My problem came from the products redindexation. I've found my solution here : Why is my wish list limited to one item?
Reindexing every indexes made my wishlist worked again for products recently added through the rest API.
To do it automatically, I've change this index to "Update on Save" in the admin : Product Flat Data - Reorganize EAV product structure to flat structure.
My wishlist works perfectly fine now (even with the "save" function).
How can i filter the link given in "link to existing content".
As in the above image. I just want WSP BANNER TO BE SHOWN.
where WSP BANNER & CALENDAR are custom post_type
Any help will be appreciable.
Currently there are no ready filters available for this purpose. A ticket has been posted for the request.Lets hope we get one soon.
Till then you can create your own filter.
Open includes/class-wp-editor.php and make folowing changes at line no 712
$pt_names = apply_filters('custom_insert_link_suggestion_filter',array_keys( $pts ));
we just added a new filter instead of getting all the public post types
Then in your theme add following code to filter the internal link custom post type
function my_filter_function($allowed_post_types)
{
if( condition chek)
{
return array('page','your custom post types');
}
}
add_filter('custom_insert_link_suggestion_filter','my_filter_function',10,1);
There is a plugin that could be helpful for you: B09 Link to Existing Content
It has a filter called "link_to_existing_content_post_types", that enables you to control which post types should be searched.
You can also use it together with this plugin, if you also want to have complete control over the search results: Search Everything.
Consider an example where my site is configured on wp.abc.com and I point my root domain www.abc.com to the new site. I need to update the URL's in General Setting. So when I update the URL, it is reflected in menu items etc. Will it be reflected in the content area links aslo?
I have a page located http://www.example.com/product/. It has hundreds of products in the listing. Each product has a URL and it is linked to the detailed page accordingly. I want to bulk update the domain name of these link.
For example, in the product list, I have:
http://www.example.com/htc/desire
http://www.example.com/htc/widlfire
http://www.example.com/motorola/atrix
...
I want to change them to:
http://www.another-server.com/htc/desire
http://www.another-server.com/htc/widlfire
http://www.another-server.com/motorola/atrix
...
Note: The links are dynamically generated by PHP, not hardcoded.
How can I bulk update the domain name of these links?
A simple str_replace?
$var = 'http://www.example.com/motorola/atrix';
$new = str_replace('example.com', 'anothers-erver.com', $var);
echo $new; //http://www.anothers-erver.com/motorola/atrix
"Replace all" in notepad might do the trick, dont you think?