Manual 'Add to Cart' link - drupal-6

Is there a way in Drupal to output an 'Add to Cart' link in static content? Like a block? Once clicked, throws 1 in the cart, and takes you to /cart?

Solved. Added 'Buy It Now' button from the Product group in a view. Could not do this in static block content.

Related

Bitrix News: created property doesn't display in the editing of an element

I created a property in the News infoblock settings.
Checkbox "Active" and "Show on the page of editing of element" is set.
But I don't see a field where I can set this property when I add or edit an element.
Please, don't send me to oficial Bitrix support. I don't need their "we'll respond you after 3 days".
Perhaps you have customized element form. If so - you can add new property to edit form
by clicking 'cogwheel' in right top corner
You need add new property on edit page of Iblock's element
See my screenshots:

How to add menuitem or button on Netsuite

Recently I built suitelet script and I want to execute that script clicking menu item.
Let me know how to add menuitem.
Otherwise I want to add button to execute that script.
For instance I want to add button on list of items.
You could be on items list page by Lists/Websites/Items.
There are already Edit View button and New Item button, but I want to add my own button.
Thanks in advance.
You add a navigation item by going to your Suitelet's Script Deployment record and adding an entry in the Links tab.
You can not script very many of the List pages, if any of them, so you won't be able to add your button here. You are able to add buttons to the pages for a single Record.
If you add your Link to the main navigation, that would seem to accomplish what you want as that navigation is available on every page.

How to disable add/edit/delete of sublist suitescript

How can I disable editing of the sublist using Suitescript user event (before load) in netsuite?
I also need to disable the inline editing.
Thank you.
You don't really need to disable editing before load, because no one can interact with sub-lists at this point. Sub-lists are like linked to the main record which means they load as the main record object loads, so the best way to prevent them from being edited is on the DOM.. which means making a form script or client-script (form preferably).
-If you know which form is used by the record go to it, else go to the record and look for "customize form" on the upper-right menu on the blue area.
-Then click on custom code.
-Add a script for "Validate Line Function" to prevent that line from being edited.
-Use the NetSuite example as a base, to prevent the line from editing you just have to return false.
function sampleValidateLine(type)
{
if ( (nlapiGetCurrentLineItemValue('item', 'custcol_service_item') == true) &&
(!nlapiGetCurrentLineItemText('item', 'custcol_service_rep')) )
{
alert("You must choose a Service Rep for this service item.");
return false;
}
return true;
}
Ideally in NetSuite you would restrict this based on permissions. For custom records, you can disable inline editing, and you can disable child record editing. The help documentation has this to say about it:
Check the Allow Child Record Editing box to allow records of this type
to be edited directly when they display as child records in a sublist
on a parent record.
https://system.netsuite.com/app/help/helpcenter.nl?topic=CARD_-29 see item 14.
You can also use form object to achieve the same. See sample code below:-
var form = scriptContext.form;
var serviceItemColumn = form.getSublist({id: 'timeitem'}).getField({id: 'item'});
serviceItemColumn.updateDisplayType({ displayType : 'disabled' })

Hide CRM form left hand side navigation item

I have my account entity linked to a custom entity called inspections, I only want these inspections to be created for accounts of a certain type. So when it isn't that type I want the left hand navigation to this entity to be hidden away. I've seen some code that says will hide it away, as long as you have the navID of the item.
I've had a crack at hiding it using what i thought could be the ID but it hasn't worked, so I'm wondering if anyone knows how to get this ID, or if there is another way to do this?
The code I'm using to hide the navigation is below:
var navitem = Xrm.Page.ui.navigation.items.get("nav_ts_inspection");
if (navitem != null)
{
navitem.setVisible(false);
}
Load the form
Press F12 to show IE Developer's Toolbar
From here you can use CTRL+F to search for the display name of the item you'd like to hide. This will give you a link that is generated. The Id of this element is what you need to use to show/hide the link.
As an example, you can see results of searching for 'Sub Accounts' on the Account screen for an installation I am working on at the moment. The Id can be seen and is 'navSubAct'
Changes by traversing DOM and manually hide an area is not officially supported.
Luckily if you are on CRM 2011, you can go to
Settings > Customization Or open the solution.
Select the entity > Forms. Inside the Form editor window, open the Form Properties of the entity.
Go to Display Tab and untick "Show navigation items" checkbox.
Finally do not forget to Publish your changes.
Use the relationshipname to hide folder in navigation like this:
If you have folder with the relationship name: ts_inspection
Use this for ID: navts_inspection
So otherwise the same as above, but lose the extra underscore (_) between nav and ts.
var navitem = Xrm.Page.ui.navigation.items.get("navts_inspection");
If you want to hide particular navigation section from the FORM then remove all the links from that section and publish it. That section will not be visible anymore.
If you want to just remove Navigation Pane from FORM, then go to 'Display' tab of form and mark as 'Do Not Show' and then publish it.

How to show list of custom objects in a page in Drupal

I want to create a page in Drupal 6 where I can show list of restaurants.When a user clicks on any restaurant page, I should be redirected to Restaurant details page.
For this :
1.) I created a new content type called "Restaurant" with some fields.
2.) Created 3-4 content items for Restaurant( Restaurant1, Restaurant2, Restaurant3)
3.) Created view called: RestaurantList, Added Fields for it. Then added Page Display and gave the path for it http://website/Restaurants
Now, when I browse to Restaurants page, I only get labels of my fields but no values. How can I get the values but not the labels? Also, I want to go to the RestaurantDetails page. How can that be achieved?
Thanks,
Rashmi
Well if I were to set up a page view this is how I would set it up:
Filters:
Node type - Restaurants
Node published - Yes
Fields
Node title
check the option Link this field to it's node
leave the Label: field empty
check option Hide if empty
And if your view style is a HTML list, for extra you can go to Row style options and check the option: Hide empty fields
Make sure you click Preview to see if you get any values. If you don't then there's something wrong with the view settings, most probably the filters which are to restrictive. Start with something loose, like Node type - Restaurants.

Resources