How to disable adding a program to Sonos favorites? - sonos

In a getMetadata call, I'm returning a mediaCollection with itemType=program. I don't want it to have the "Add Station to My Sonos" option. So I tried returning it with canAddToFavorites=false but it doesn't change a thing. The "Add Station to My Sonos" option is still there.
http://musicpartners.sonos.com/node/286
canAddToFavorites boolean (Optional, default=true) The collection can be added to user favorites.
How do I disable this option if it's not with canAddToFavorites? Does it only work for some specific itemType?

The canAddToFavorites is a marker to disable the ability for a user to add the item to the PARTNER favorites. In other words, if Acme Music Service has their own notion of a list of favorited tracks/albums/stations, a user can, from inside the Sonos app, save an item to that list. This flag conditionally prevents that. So it has nothing to do with "My Sonos". Currently there is no way to prevent an item from being added to My Sonos, unless you mark it as isEphemeral.

Related

Manually approving the account in shopify after registration

Whenever the user register on my Shopify website i want that account to be disabled until admin enable it from back-end panel. Currently when user is registered, his account is enabled by default.
Have searched various forums even tried Shopify support but still no luck.
There are two options. why you are not putting "request membership" sign up form instead of sign in form (disable from here)? You could use the contact page for that if you wanted. Then you get an email when they fill that out. You would create the account (just copy and paste the info) and email them an invitation. They click the link in the invite to make the password. (I think it will be a tedious task for you)
Otherwise, let them create the account, but hide the pages with the Locksmith app. Then after you approve them you would apply a "tag" to the customer account so they can see the pages and products locked with Locksmith.

Joomla, assing menu-item to particular user

I am designing a photographers website.
What i need to do is allow every logged in user to view -ONLY- his portfolio and no other.
Since i haven't found any extension that does that in style, i decided to use a general portfolio extension, and create a portfolio for each user.
Then i need to find a way so that when a user logs in, with his username/password, a menu-item will appear that will hold -ONLY- his portfolio.
So my question is, how can i do that???
Assign a single menuitem to a single user.
Thank you.
The only idea I have in mind is to use user groups here. Create the user, create the user group, assign the user to the group and assign that group to the object you want to protect.
If it's just about showing images I have another idea.
I build that user group specific handling into Event Gallery, a Joomla! gallery component: https://extensions.joomla.org/extensions/extension/photos-a-images/galleries/event-gallery/
Doing this make creating different menu items unnecessary. Once the user logs in he can see his content. In addition the content is protected. A simple menu item might not do that trick.

Shopify: Change metafields for store

My problem is that when you login on my store - you (not necessarily registered) could add your e-mail and other information.
In this topic:
https://ecommerce.shopify.com/c/shopify-apps/t/allowing-a-customer-to-edit-their-profile-and-metadata-186665
I see that there is a possibility to change the metafields of the customer.
But I need to change the metafields of the store.
Does someone know where to find a list of requests or is there any options to change Metafields?
If you, as somebody with admin access to the store, needs to manually set or modify metafields on your store and either don't want to (or cannot) use a custom app to do so:
Get the (free) ShopifyFD extension for your browser (Link to the extension on the Chrome store)
Log in to your store and go to the 'Settings' (gear icon)
Click ShopifyFD's green '+' icon in your browser to load the extension on the page. You should now see your store metafields appear
You can now add metafields by filling in the boxes, or select existing metafields to manually edit their values.
Note: Metafields that are set by any of the apps that your are using should generally not be edited manually - changing an auto-generated field could really confuse the app that relies on it!

Broadleaf commerce display some product to logged in users only

I am developing an e-commerce application using broad-leaf commerce.
My requirement is I have to add an product from login panel and display that product to only logged in users. Here few product products will be visible to all users (guest too) and few will be visible to only logged in users.
is there any way to do this?
Thanx soulfly1983 fou your try,but I found another alternative to do this without any customization. here is the full procedure..
Add a new category from admin panel.
Add a new page from admin panel (under content tab) and note the URL should be the same of category and page.
3 In the page click on rule tab.
4 Check the yes button in "Restrict to certain customers?"
Click +rule button and the select "match all" and select customer registered is equal to false
So this page will be visible to only guest users.
In the HTML body section of the rule (in general tab) write a message "you need to log in to view this stuff"
When user will log in successfully the user will not be able to the page , because we applied a rule that only logged out users can see the page so this time user will see the category and products added to that category.
am I doing right? any regarding this suggestion?
You can either extend the Product entity and add a field that will indicate whether that product will be visible to all users, or alternatively you could simply add an attribute for each product via the admin interface. Either way you will need to modify the UI logic so that it will take this additional field (or attribute) into consideration.

New module for personal collection/receive with possibility to choose shop (pickup to store)

I want to add possibility for clients to receive orders personally in one of our shops. I tried to find some module which gives possibility to select in which shop they want to receive order but I haven't found anything for free. Because of that I want to create new module for it. What's more I'm totally new in prestashop and I don't know where to start or how to create this module. I spend two-three days reading how to do it and these are my assumptions:
New carrier module can be created by extending CarrierModule class.
I read some articles / documentation about hooks.
I have created my first carrier module by editing module attached in this article http://www.prestashop.com/blog/en/carrier_modules_functions_creation_and_configuration/.
What I achieved is that I installed module and used hook 'BeforeCarrier' to add some layout to page after selecting my carrier.
This is how my carrier should work:
It should be a part of carrier list so customer is able to select it.
If carrier is not selected nothing hapens. If carrier is selected by customer then button 'Choose shop' should be shown.
After pressing button 'Choose shop' new window should be show with addresses of our shops (instead of new window it may be placed somewhere in current page).
Window with shop adresses will contain list of addresses with radiobuttons and button to confirm selection.
After confirmation of selection window will be closed and address should be shown as a part of carreir.
E-mail with confirmation will contain information in which shop customer can collect order.
Suppose that addresses will be hardcoded in php code.
These are my questions:
I created new carrier module so I assume it works correctly (as described here http://www.prestashop.com/blog/en/carrier_modules_functions_creation_and_configuration/).
How to add new button 'Choose shop' near selected carrier?
Can I use hooks to add 'Choose shop' button?
Where should I remember choosen shop address? Has 'Carrier' class place for it?
How to add shop address to e-mails? Should I edit layouts? Does e-mail layout contain place for it or do I need to add new 'placeholder' for it?
How to show chosen address on admin side?
To describe my problem more detail I have created few scenario (see attachment).
I will be greatful for any help.
I've posted the same question on prestashop forum.
These example are usually old and poorly written. They lack structure. But for your purpose I suppose they're ok.
Use hookDisplayCarrierList($args). Check $args to see which carrier has been selected, then return <select> element which you
shop addresses. This hook is triggered every time a user selects a carrier and is return via Ajax. Therefore, you may not use ajax here.
You should include you javascript in a file. Use hookDisplayHeader to detect when to insert this file into your page:
public function hookDisplayHeader(){
$propExists = property_exists($this->context->controller, 'php_self');
if($propExists){
$controllerName = $this->context->controller->php_self;
if(in_array($controllerName, array('order', 'order-opc'))){
// $this->context->controller->addJS($this->_path.'js/customcarrier.js');
This Javascript file should check whether a valid shop has been selected before going to the next step;
Because your Js code is in a file and the hookDisplayCarrierList cannot contain any JavaScript (because it returns Ajax),
you should also make use of hookDisplayBeforeCarrier. Here you could insert you custom carrier ID - this way you'd know
when to check for errors with your JS file.
Same question as #2.
The correct way to save the information would be to add a model. CustomCarrierSelectedAddress - or something like it.
It would have these columns: id_cart, id_shop_address;
The way you implement shop addresses is up to you. You may define them as constants or even make a new model for them.
Models arent that hard to create, you just need to declare class properties, static variable $definition that's it.
You may add you own methods. You should also add createTable()/dropTable() methods for convenience.
This is more complicated. You could:
Send your own email about selected shop address.
Search the controller method which send the email you wish to change.
Then you should override that method by copying the file to your module, delete all the other methods and
rename the class definition inside -> class AdminAddressesController extends AdminAddressesControllerCore
There should be an array of email placeholders and their values, which the controllers assigns.
for example '{order_id}'. You should add your email variable to array {chosen_shop_info} and assign whole
paragraph of text to it. Then you may use it in the actual email template which you can edit in BO.
This is more or less the only way I know to edit the existing templates, because you can't do conditional statements inside email templates.
To add chosen address to order page in BO, you should use another hook - hookDisplayAdminOrder.
here you can add your own block to be display in order summary.
To find out which hooks are available, go to Hook.php and look for method exec(). Add this line error_log($hook_name).
When you perform a specific action, executed hooks will be logged and you will see what kind of hook you need.