Now I have read over dozen threads and even a dozen different web pages which have asked the similar question. However the responses did not work for me. I tried all of them. Also to note I could not comment on the questions hence the reason for this thread. To be as detailed as possible FROM what i can tell in the magento checkout is something to do with SHOPGRAM? It is my current checkout cart. I have two custom attributes called license_period and another called number_of_devices.
I need to add the two fields within the checkout cart. One thing to note is that is out of the testing i have done it seems the file cart_new.phtml located # /app/design/frontend/shopgram/default/template/checkout controls the layout. this script i have tried editting I have tried alot however any change i make does not even appear. Even when i edit the default.phtml #/app/design/frontend/shopgram/default/template/checkout/cart/item It does not make any changes i have even deleted most of the files in these directorys and it causes no change to the content. Only the cart_new.phtml controls the content.
Now i do not know magento too well so i might be mistaken. However when i did try a lot of different queries and most of them do nothing. some of them cause the table to disapear.
The following are just a 2 out of the 100 links I have tried. However I can only post two links.
Display Magento Custom Option Values in Shoping Cart
https://magento.stackexchange.com/questions/5057/magento-checkout-getting-custom-attribute-value
Posting this script Here incase anyone needs to know how to add custom attributes into your shopping cart.
/**
** This will load the product attributes. Now you can create a plugin to do this which will
**help with performance however in my case the plugin was not working correctly.
**/
<?php $_product= Mage::getSingleton('catalog/product')->load($_item->getProductId()) ?>
/**
**Use javascript to add the attribute into the correct location in the shopping cart.
**
**/
<script>
var elements = document.getElementsByClassName('item-options'), last = elements.length - 1;
elements[last].innerHTML = "<dt>Odkaz </dt><dd>Instalační soubor</dd> <dt>No Of Devices:</dt> <dd><?php echo $_product->getResource()->getAttribute('number_of_devices')->getFrontend()->getValue($_product); ?></dd> <dt>License Period:</dt> <dd><?php echo $_product->getResource()->getAttribute('licence_period')->getFrontend()->getValue($_product); ?></dd> ";
</script>
PS
You will find This script was placed in the cart_new.php which is located #app/design/frontend/shopgram/default/template/checkout.
Another piece of advice is that if you place this code anywhere in the script it will not work. So do not get fustrated if it does not work. It has to go somewhere where it will not block the other scripts from working. I placed mine within the the actual for each items as items loop where it draws the data for the shopping cart.
Related
I'm trying to make a desktop app with java to track changes made to a webpage as a side project and also to monitor when my professors add content to their webpages. I did a bit of research and my current approach is to use the Jsoup library to retrieve the webpage, run it through a hashing algorithm, and then compare the current hash value with a previous hash value.
Is this a recommended approach? I'm open to suggestions and ideas since before I did any research I had no clue how to start nor what jsoup was.
One potential problem with your hashing method: if the page contains any dynamically generated content that changes on each refresh, as many modern websites do, your program will report that the page is constantly changing. Hashing the whole page will only work if the site does not employ any of this dynamic content (ads, hit counter, social media, etc.).
What specifically are you looking for that has changed? Perhaps new assignments being posted? You likely do not want to monitor the entire page for changes anyway. Therefore, you should use an HTML parser -- this is where Jsoup comes in.
First, parse the page into a Document object:
Document doc = Jsoup.parse(htmlString)
You can now perform a number of methods on the Document object to traverse the HTML Nodes. (See Jsoup docs on DOM navigation methods)
For instance, say there is a table on the site, and each row of the table represents a different assignment. The following code would get the table by its ID and each of its row by selecting each of the table's tags.
Element assignTbl = doc.getElementById("assignmentTable");
Elements tblRows = assignTbl.getElementsByTag("tr");
for (Element tblRow: tblRows) {
tblRow.html();
}
You will need to somehow view the webpage's source code (such as Inspect Element in Google Chrome) to figure out the page's structure and design your code accordingly. This way, not only would the algorithm be more reliable, but you could take it much further, such as extracting the details of the assignment that has changed. (If you would like assistance, please edit your question with the target page's HTML.)
I have got a webpage with a few functions on it to load different content dynamically into the content section. What I want to achieve is by pressing back button to execute last/previous function. At the moment it goes to the previous page. Is it possible to do without hash tags in the URL bar as well? Seems like create a history of function list. Thanks
I suggest you to use the session.
Note that there is a plugin named JQuery session plugin, available from here
Tutorials links :
Lassosoft
weschools
In my application, I have a grid populated with some data, I am displaying 2 columns in the grid..ie, name and noOfScripts. But when I double click on the grid, I want scriptname and parameters also to be displayed( and the number of times it is displayed is based on the noOfScripts) in the Window/Form.
I am using Java Servlets for the backend, Now I am not sure if I have to add the script details into the same Main Class or not? How should I handle the script details?
Check this: this is how I add these data:
Here
Should I save scriptname and parameters along with the main data?
Is it possible to store multiple values, if I add scriptname and parameters to the main Store? or should I create a different store for Script?
If I am creating a different store called Scripts..How I should be mapping it to the data record? Are there any methods provided by ExtJs that helps achieve this?
Not sure If my explanation on the problem is clear or not. Do let me know if it is not clear, I will try to make it clear.
Please suggest me if there is something helpful. Any suggestions, ideas or references will help.
Thanks in advance
I suggest you to create a model and a store for Script and on rowitem click - populate a window with the data from the Script store.
ExtJS4 has support for model association (more here) but the mechanism is too complex so i prefer a simplier take on it:
Add MainModelId to Script model and simply filter the Script store every time you show your modal window (grid item click)
Im new to java and working on a simple application that monitor an url and notify me when a table is updated whit new items. Looking at the entire page will not work as there are commercials that change all the time and they would give false positives.
My thought was to fetch the url line by line looking for the elements. For each element I will check to see if the element is already in an arraylist. If not the element is added to the arraylist and a notification is send.
What I need support with is not the exact code but advice if this would be a good approach and if I should store the elements in an array list or if I should use a file instead as there are 2 lines of text in each element.
Also It would be good to get recomandation on what methods and libs there would be good to look at.
Thanks in advance
Sebastian
To check the site it'd probably be more stable to parse the HTML and work with an object representation of the DOM. I've never had to do this but in a question regarding how to do this another user suggested using JTidy, maybe you could have a look at that.
As for storing the information (what you currently do in your ArrayList): this really depends on what you use your application for. If you only want to be notified of changes that occur during the runtime of your program this is perfectly fine. If you want to have the information persist you should find a way to store the information in the file system or database.
I've been trying to figure out the answer to what I believe is a very simple question but have had no luck thus far. Unfortunately I'm not very well versed in html or java as of yet.
At my employment my team is faced with manually typing out a series of sentences that are always the same each time with the exception of one variable. These are required documentations and become rather monotonous and time consuming when manually entered each time. In addition to this- the computers are ancient and memory intensive scripts would be more bothersome than beneficial- even if it means more code I'm looking for the quickest, least intensive solution, that I can present to the whole team at once.
My objective is to create a series of forms and then have the variables inserted into pre-constructed sentences and copied as a whole to the clipboard all at once.
I can only create the forms successfully and have had no luck with either; A) posting the sentences with the variables into a text area so that it can be manually copied or B) the more preferred result of clicking a submit button to have it generate the pre-contructed sentences in the background unseen while including the variables and copying it all to the clipboard.
Essentially... I want something like this-
Name -----
Age-----
Gender-----
Job-----
SUBMIT
Upon clicking submit it would copy all the text below to the clipboard without displaying it-
Person of interest, $name, was recently added.
The person of interest works as a $job and has not recently undergone surgery.
$name is $gender and is currently $age.
I know this is possible although I have no idea how to actually achieve it. I thought at first I could just create the form data, attach it to a variable in php, echo the variable in sentences in a display:none environment then have it all copied with... no idea, maybe I was going to assign all of the echo'd sentences to yet another variable and then have the submit button copy the variable to the clipboard. Even just saying that is painfully inefficient. I need serious help on this guys =(
I guess you can use $_SESSION variable with random string placeholders for variables.
$_SESSION['message']="Person of interest, <<name>>, was recently added.\n...."
When the form is submitted, just replace the placeholders with actual values into it, like:
$_SESSION['message']=str_replace('<<name>>',$_POST['name'],$_SESSION['message']);
Then, whenever you have to use the statement, you can use it as,
<textarea id='message'><?php echo $_SESSION['message'] ?></textarea>