Magento 1.9 Transactional Email Variable Edit - html

So ive tried for 2 months to find the source of my headache to no avail.
Within magentos default transactional emails is for example the "Wishlist" Email, triggered on user input to fill with the specified list of products in the users wishlist and email said list in a grid layout to a recipient of choice.
My problem is this, the HTML for the email specifies only Var_items and Var_grid as the variables that get and input the products into the table. The styling for this table seems to have a fixed pixel size and when inserted into dynamically sized emails it messes them up considerably, my simple goal is to change the styling of these grids to better reflect the emails, but i cannot find it anywhere.
Does anyone have any idea where i should look and what im looking for? Thank you kindly in advance for your assistance. I dont know where else to turn at this point.
Cheers!

Template for wishlist items is located at
/app/design/frontend/base/default/template/wishlist/email/items.phtml
take a look at block class Mage_Wishlist_Block_Share_Email_Items
Default template has some fixed values indeed. But you can replace it in your custom theme.
<table cellspacing="0" cellpadding="0" border="0" width="650">
<tr>

Related

Visualforce / Apex: Access two objects with one controller

I'm forcing the problem that I have to set up a visualforce page rendered as pdf, which outputs a automatically generated invoice. Because of intern workflows this page has to be set up to the Opportunity object.
Most of the fields used are taken from the Opportunity object itself and work fine.
But I also need access to the OpportunityLineItem fields to display the products on the invoice.
How can this be realized? Do I have to write a controller extension in apex or is it possible without?
As an alternative, would this eventually be possible with cross formula fields referring from Opportunity to OpportunityLineItem? I tried this, but could not find any possibility to select OpportunityLineItem in a formula field in the Opportunity object.
Any help is much appreciated. Thanks!!
Below is a sample page accessing the OpportunityLineItems for a given Opportunity using the standard controller ammended from this doc reference.
<apex:page standardController="Opportunity">
<table border="0" >
<tr>
<th>Description</th><th>Quantity</th>
<th>Unit Price</th><th>Name</th>
</tr>
<apex:repeat var="oli" value="{!Opportunity.OpportunityLineItems}">
<tr>
<td>{!oli.Description}</td>
<td>{!oli.quantity}</td>
<td>{!oli.unitprice}</td>
<td>{!oli.Name}</td>
</tr>
</apex:repeat>
</table>
</apex:page>
With respect to formula fields, you cannot access child fields in a formula on the parent for the simple reason that it is a one to many relationship. The parent Opportunity would not know which of the children to lookup to.
The best you can do is make a regular (text or whatever) field, run a Process Builder triggered by a change to the relevant field(s) on the parent (opportunity) and trigger a Flow to loop over the children (LineItems) and make the changes to the parent based on some condition you specify.

Is there a way to access the first element in a column on a website using VBA?

Here is a screenshot of a column in a website page.
It is located in that way in the website page :
As you can see, all the rows have a 'Completed' button you can pres and followed by a number of lines. These rows refer to exports. So the columnis not static and is constantly changing.
However, everytime i run the macro i want to access the first row of the column.
Here is a sample code of he HTML code of the first 'Completed' button in the screenshot above:
I have many that have the same class name. Look at the highlighted rows as an example in the picture below:
I really have no idea how to write a VBA code to always access the first 'Completed' bytton in this column.
PS: In the HTML code, in the tag "a", the onclick="....." is constantly changing. So i cannot use this as an argument to access the desired field and click on the desired button.
Please if anyone could help me figure out how to do this, i would really be happy.
Thank you :)
If you want to click the 'Completed' button in the first column, you can use the code below:
Set doc = objIE.Document
doc.getElementsByTagName("tr")(0).getElementsByTagName("td")(0).getElementsByTagName("a")(0).Click
The code get the first <tr> then get the first <td> then get <a> in it.
<tr> tags are rows, <td> tags are cells inside those rows. You did not provide enough code to show the entire table, but generally speaking to access the first row of a table, you would need to refer to the collection object and use the index number you want.
.getElementsByTagName("tr")(0)
This will refer to the first row of a table. Same with getting the first column in the first row of your table:
.getElementsByTagName("tr")(0).getElementsByTagName("td")(0)
Once you tracked down the particular cell, now you are wanting to click the link. You can use the same method as above.
.getElementsByTagName("tr")(0).getElementsByTagName("td")(0).getElementsByTagName("a")(0).Click
And a final note, the first row of a table could be a header, so you may actually want the 2nd row (1) instead.
Thanks for updating with more HTML code. I am going to slightly switch gears and use querySelector() to grab the main table.
doc.querySelector("#divPage > table.advancedSearch_table > tbody"). _
getElementsByTagName("tr")(3).getElementsByTagName("td")(3).Children(0).Click
See if this works for you.

Netsuite Advanced PDF/HTML add custom column if value

I need help with adding a custom column with id 'item.custcol_new_unit_price'.
If there is a value for this column on any item, I need this column to appear on the printed form. I would think it would be something like this:
<td align="right" colspan="4"><#if item.custcol_new_unit_price>${item.custcol_new_unit_price}</#if></td>
Any assistance would be helpful. Thank you!
Try:
<td align="right" colspan="4"><#if item.custcol_new_unit_price?has_content>${item.custcol_new_unit_price}</#if></td>
Source: http://freemarker.org/docs/ref_builtins_expert.html
Is this field being displayed in the UI? If you want a custom field to be available in Advanced PDF/HTML Templates, it needs to be checked to "Show" in the Screen Fields tab when you customize the form. If you don't want the field visible in the UI, you can usually trick the system to hide it by making the Label empty.

How can I hide the HTML in a gravity form field from appearing in te confirmation message?

Basically I am using a radio button field and have added HTML in the field itself to link and a preview plugin class like so
Field: Sedan, 3-passenger View
And this works fine except when the form gives confirmation message using the corresponding field's merge tag {vehicle you would like} it shows the entry and all the HTML as a string as well, which obviously is a problem. How can I fix this issue and have the confirmation treat the html as such? Do I have to add all of this html as a class instead and apply it to the unique entry css instead of inline or is there some way to mess with the merge tags or with minimal css changes to the confirmation message classes?
The stuff in the confirmation field in the form UI (using inline styles to test for now, I know its not the best way but either way doesn't really solve my problem):
<p style="text-align:center;"><strong style="font-size:16px;"> Thank you!!!</strong>
We will send you an <strong style="color:#8E0F0F;">Email Quote</strong> within the next <strong style="color:#8E0F0F;">30 minutes.</strong>*
*Subject to Driver Availability.
<strong style="color:#8E0F0F;">Important Warning: When we send you an Email Quote, it might end up in your SPAM/JUNK EMAIL folder, so please double check that folder.</strong></p>
<strong>Submitted:</strong>{date_mdy}
<strong>Status:</strong> Waiting to be accepted by a Service Provider.
<strong>Pick Up:</strong> On{Pick-Up On::7}, at {At::8} at
{Address (Street Address):9.1} {Address (City):9.3}
<strong>Drop Off:</strong> {Drop-Off Airport/Cruise Port:10}
<strong>Passenger or group name:</strong> {Passenger/Group Name:15}
<strong>Number of Passengers:</strong> {Number of People in the Group:16}
<strong>Contact Person:</strong>{Contact Person's Name:17}
<strong>Quote will be emailed to:</strong>{Contact Person's Email:18}
<strong>Rate:</strong> {What Type of Vehicle Would You Like?:6} Quote to be Provided. <strong>15% Online Discount Active!</strong>
Extra question on the same form, is there any way to attach a timestamp to the {date_mdy} merge tag so it actually includes the time of submission in the confirmation and not just the date? Obviously the hook exists since entry time is shown in the WP backend but I don't know how to go about getting it to work here. Thank you for any replies, this car reservation form has been a headache.

formatting the CSS in a HTML table to have one line per cell

I'm developing a webpage to server as a quick reference tool in our work, and I'm using Google's Visualization API Google Visualization to help speed up things. However, I have a column called 'Database', which have a bunch of databases used by our company:
tc2007 tc200711 tc200712 tc200713 tc200714 tc200715 tc200716 tc200717 tc801 tc2008 tc200718 tc20072 tc810 tc200721 tc820 tc83i tc811 tc830 tc90 tc10ms1/tc10ms2 tc91
When I do a search, I would like to have each one of those values above being displayed one element per line, does not matter how many there are, or how large is the table cell going to be. Does someone know how to modify the CSS in other that would work? Now the values are put aside each other in the table, so the formatting does not look good.
can't you just set the width of the column?
<td width="50px">....</td>
in CSS
.table td
{
width: 50px
}