w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Find the Last Price that is different from the Current Price
You can do this using the lag() function first to find when the price changes: select ItemNumber, max(case when seqnum = 1 then Price end) as LastPrice, max(case when seqnum = 2 then Price end) as PriorPrice from (select t.*, row_number() over (partition by ItemNumber order by TrxDate desc) as seqnum from (select t.*, lag(Price) over (partition by ItemNumber order by TrxDate) as PrevPrice from t ) t where Price <> PrevPrice or PrevPrice is NULL ) t group by ItemNumber; Lag is only available starting with SQL Server 2012. If you don't have lag(), you can do the same thing with a correlated subquery: select ItemNumber, max(case when seqnum = 1 then Price end) as LastPrice, max(case when seqnum =

Categories : SQL

What is the difference between debug and retail binaries in .NET?
This post may definitely answer your question. When compilation debug=”false”/ is set, the WebResource.axd handler will automatically set a long cache policy on resources retrieved via it – so that the resource is only downloaded once to the client and cached there forever (it will also be cached on any intermediate proxy servers). If you have Atlas installed for your application, it will also automatically compress the content from the WebResources.axd handler for you when compilation debug=”false”/ is set – reducing the size of any client-script javascript library or static resource for you (and not requiring you to write any custom code or configure anything within IIS to get it).

Categories : Dotnet

SSDT with large, retail databases?
Try creating a dacpac of the existing database (use SQLPackage to generate it), then reference that as a DB Reference in your project as "same database". I blogged about using SQLPackage and database references here: http://schottsql.blogspot.com/2012/10/ssdt-external-database-references.html That way your project will contain just the objects you are creating but still reference the existing objects.

Categories : Sql Server

How to construct price time series from price changes using MS-Access 2007 queries?
One remark before we start on a solution: be careful not to use reserved words for field names. Timestamp is a reserved word. Access will let you name a column that way, but you may encounter strange issues later on, especially if you ever move to another database in the future or use some other tools that fetch data from your Access database. So here, I renamed your Timestamp column to DateTimeStamp. I think that your requirements would be more straightforward to implement in VBA rather than in pure SQL queries: while you can easily build a query that gets you the average of each category per day, you are going to struggle to fill-in the data for the days where you have no data. Simple but incomplete SQL solution However, maybe having these holes in your data isn't that much of an iss

Categories : Ms Access

Magento : How to display selected custom option price in product detail page In price box
first of all you have to put button calculateprice then onclick of calculateprice you have to call function chkprice() function chkpice() { var a=document.getElementById("options_1_text").value; var b=document.getElementById("options_2_text").value; var c=document.getElementById("options_3_text").value; var d=document.getElementById("options_4_text").value; var e=<?php echo $_product = $this->getProduct()->getPrice()?>; var f=(a+b+c+d)+e; var e=document.getElementById(('product-price-'+<?php echo $_product = $this->getProduct()->getId()?>)).innerHTML; $('product-price-'+<?php echo $_product = $this->getProduct()->getId()?>).innerHTML =''+e.replace(<?php echo $_pro

Categories : PHP

Magento: Show price ranges of custom option prices in list.phtml instead of base price
On category list page app/design/frontend/default/{theme}/template/catalog/product/list.phtml <?php if($_product->getRequiredOptions()) :?> <span class="start-at">Starting at:</span> <?php // need to format currency - echo Mage::helper('core')->currency($_product->getData('min_price'), true, false) ?> <?php echo $_product->getData('min_price') ?> - <?php echo $_product->getData('max_price') ?> <?php else: ?> <?php echo $this->getPriceHtml($_product, true); ?> <?php endif; ?>

Categories : PHP

On the basis of quantity and product price, total price Update
var price = $('#totalprice').val();//this is wrong!!! get the html of span.Not the value var price = $('#totalprice').text();//this is the correct syntax So,Your code becomes--: $('#quantity').keyup(function () { var qty = $('#quantity').val(); var price = parseInt($('#totalprice').text()); //or $('#totalprice').html() var total = price * qty; $('#totalprice').html(total); });

Categories : Javascript

show minimum advertising price instead of price if avaliable in magento 1.7
Adding a condition inside your template (phtml) file would cause issues for you. This price would be shown to the visitor, but the actual price field would be used in calculations / cart etc so there could be a mismatch. The simplest way to do what you want would probably be to override the Product model and/or Product Price Model. Mage_Catalog_Model_Product Mage_Catalog_Model_Product_Type_Price there's a load of guides on how to override models: http://magento4u.wordpress.com/tag/override-catalog-product-model/ For simplicity you could just copy the class into the local namespace which would override the class without having to create a module/xml etc. class Mage_Catalog_Model_Product_Type_Price { /** * Default action to get price of product * * @return decimal

Categories : PHP

How to send array of price-infos in foreach loop to external PHP as POST data with Ajax and back into each product price div?
Keep product id as string with comma(,) separated like (123,456,789) and send it to your ajax page. On ajax page, use PHP function explode to convert into array and fetched price of products. And keep that all product price into a string, like (123:20:15,456:40:30,789:50:35) use javascript function split by comma(,) so that single product id and price will convert into array. Array( [0]=>123:20:15, [1]=>456:40:30, [2]=>789:50:35 ) Now again perform same javascript split function by (:) with each array value then array will create like Array( [0]=>123, [1]=>20, [2]=>15 ) Hope it will help

Categories : PHP

finding the discount price from an article having price codes
The problem that you're experiencing is that scanf() only grabs a single character from the input buffer. This would be fine, except that there's still a newline left in the input buffer that resulted from hitting 'enter' after your input.. You need to clear the input buffer after you use scanf() like this: do scanf("%c", &code); while(code == ' '){scanf("%c", &code);} or flash the buffer

Categories : Misc

If the price is promotional, check if it is lower than original price
I don't know which DB you use but try something like this : MIN( ROUND(CAST(MIN(`map`.`Product_Price`) AS DECIMAL)/100,2) UNION ROUND(CAST(MIN(`map`.`Product_Promotional_Price`) AS DECIMAL)/100,2) ) as `minProductPrice`

Categories : Mysql

the total price in the datagrid when I passed it round that price
Your problem is that you are converting a price like "1.20" to an int with Convert.ToInt32(textBox1.Text);. Try change Postresinfo.refPostre to a decimal and use Convert.ToDecimal(textBox1.Text); so use something like this as a FormatException could be thrown: try { Convert.ToDecimal(textBox1.Text); } catch (Exception) { //Deal with Error }

Categories : C#

Retail Database Design - Multiple Products with different accessories
You don't need a separate table for each product -- that's madness. You describe a many-many join, which is usually implemented using a table that can join accessories to product/model. Assuming you have IDs for each product and accessory: | product | accessory | | 5 | 4 | | 5 | 5 | | 5 | 6 | | 5 | 7 | | 6 | 4 | | 6 | 5 | | 6 | 6 | | 6 | 7 | | 6 | 8 | | 6 | 9 | In this table, product 5 (say, an iPad 2) can have accessory 4, 5, 6, and 7 (covers). Because the way these covers are designed, they also work with product 6 (an iPad 3). Accessories 8 and 9 are designed specifically for product 6, and won't work with product 5.

Categories : Mysql

Error when implementing wso2 retail banking sample
As per https://docs.wso2.com/display/ESB460/Configure+with+ActiveMQ you will need to add hawtbuf-1.2.jar to your app server

Categories : Wso2

Java generics - naming actual types of actual type
You need a second generic parameter: public interface MyInterface2<U estends MyAbstractClass, T extends MyInterface1<U>> { U returnInstanceOfMyClass(); }

Categories : Java

AngularJS Slider with min-price and max-price columns
:) How about using the slider to update an upper and lower price bound on the scope, and then filtering on those bounds: http://plnkr.co/edit/uF31rMbNLzF382GUZYqr?p=preview

Categories : Angularjs

how to link a product tables of a distributor and many retail outlets relations? mysql
if each retailer can have many distributors and each distributor can have many retailers then you are looking for a many-to-many relationship which would require a new table distributor_retailer -------------------- distributor_retailer_id | retailer_id | distributer_id 1 1 1 2 1 2 3 2 1 where retailer_id and distributor_id are foreign keys to the respective tables. with this data retailer 1 deals with distributors 1 and 2. Also retailer 2 deals is distributor 1. You can also look at it the other way around. Distributor 1 deals with retailer 1 and 2. Also distributor 2 deals with retailer 1.

Categories : Mysql

Create a retail store map by plotting xy coordinates using some web based code (javascript, jquery, html, etc)
Try this library http://draggabilly.desandro.com/ html: <h1>Draggabilly - with jQuery</h1> <div class="draggable"></d script: $(document).ready( function() { var $draggable = $('.draggable').draggabilly(); }); try it on http://codepen.io/desandro/pen/yyRapr

Categories : Javascript

how to add tooltip to show price range change at handles when a customer adjusts the price range slider bar in ecommerce project?
I notice that you've tagged your question with Twitter-bootstrap, so I take it that you are using that in your project? If so, can you add the rel="popover" data-placement="bottom" attributes to your tags. E.g. <a class=​"ui-slider-handle ui-state-default ui-corner-all" rel="popover" data-placement="bottom" href=​"#" style=​"left:​ 0%;​" data-original-title title>​</a>​ Then on your jQuery, you can just select the item and add the details: $("#sliderId").tooltip({ animation: true, title: "Your title here" }); List of attributes able to enable through bootstrap here Failing that, there is a nice slider available for free with tooltip already enabled: Eyecon slider for boostrap Edited following comment: Depending on how you are binding the data, it s

Categories : HTML

Converting irregularly time stamped Dateframe object, having price and volume information into equally spaced, volume weighted average price
I think I would create a new column for the total sold, and do two resamples: In [11]: df['total'] = df['price'] * df['amount'] In [12]: df.total.resample('30S', how='sum') / df.amount.resample('30S', how='sum') Out[12]: 2011-04-17 01:03:00 1.025700 2011-04-17 01:03:30 1.025700 2011-04-17 01:04:00 NaN 2011-04-17 01:04:30 1.025700 2011-04-17 01:05:00 1.025700 2011-04-17 01:05:30 1.025700 2011-04-17 01:06:00 1.025700 2011-04-17 01:06:30 1.025650 2011-04-17 01:07:00 1.025615 2011-04-17 01:07:30 1.025630 2011-04-17 01:08:00 1.025630 2011-04-17 01:08:30 NaN 2011-04-17 01:09:00 NaN 2011-04-17 01:09:30 1.025700 2011-04-17 01:10:00 NaN 2011-04-17 01:10:30 1.025700 2011-04-17 01:11:00 1.025700 Freq: 30S, dtype: float64 Assum

Categories : Python

Magento simple product custom options price as product price
I'd suggest you take the cheapest option (probably the 100g option) and enter its price as price for the product. Then you define the option price as t the difference between the option price and the 100g price. Example: Apples, Price = 0.99$ Define the individual options as follows (pricetype: fixed) 100g: +0 $ [optional] 200g: +0.85$ 300g: +1.60$ That way the cheapest price is shown in the product listing and the real price gets updated on product detail view page when the user selects the amount he wants to buy.

Categories : Magento

Ajax to GET the price via php
Try this one make sure you have included jquery and then onchange of length dropdown make an ajax request to your php file where your are fetching price <select name="Category" class="Category"> <select name="Category" onchange="getprice(this.value)"> function getprice(length) { if (length== "") { } else { $.ajax({ type:'post', url:'your.php', data:{length:length,category:$(".Category option:selected").val()}, success:function (data) { $(yourhtmlelement).html(data); } }) } } Hope this makes sense

Categories : PHP

Character set for price
Create a list of countries where your in app purchase is available. Turn that list into an NSArray of locale identifiers. Iterate over that array and create a NSLocale Use this locale to create a price string with a NSNumberFormatter Save all the characters you have used. ??? Profit Something like this should do it: NSNumberFormatter *nf = [[NSNumberFormatter alloc] init]; nf.numberStyle = NSNumberFormatterCurrencyStyle; NSMutableSet *set = [NSMutableSet set]; // all available locales, you probably don't need them all NSArray *availableLocaleIdentifiers = [NSLocale availableLocaleIdentifiers]; // compile a list of the locales you'll need availableLocaleIdentifiers = @[ @"de_DE", @"de_CH", @"en_GB", @"en_US", @"ja_JP"]; for (NSString *localeIdentifier in availableLo

Categories : IOS

how to get price with ebay API
You can try it with findItemsAdvanced.searchResult.item.sellingStatus $price = $item->sellingStatus->currentPrice; searchResult.item.sellingStatus.currentPrice Amount (double) The current price of the item given in the currency of the site on which the item is listed. That is, currentPrice is returned in the original listing currency. For competitive-bid item listings, currentPrice is the current minimum bid price if the listing has no bids, or the current high bid if the listing has bids. A Buy It Now price has no effect on currentPrice. For Basic Fixed-Price (FixedPrice), Store Inventory (StoreInventory), Ad Format (AdFormat), and Classified Ad (Classified) listings, currentPrice is the current fixed price.

Categories : PHP

MIN/MAX price for each product (query)
SELECT (MIN(`map`.`Product_Price`)) as `minProductPrice`, (MAX(`map`.`Product_Price`)) as `maxProductPrice`, `pr`.`Product_Name` as `productName`, `map`.`Product_Id` FROM `bm_market_products` as `map` JOIN `bm_products` as `pr` JOIN `bm_markets` as `ma` WHERE `map`.`Product_Id` = `pr`.`Product_Id` GROUP BY `map`.`Product_Id`

Categories : Mysql

Get each price per month for a category?
=SUMIF(E:E,E2,C:C) will sum the categories for you I think if you want to sum categories by date, you might want to use a Pivot Table or write a Macro You can write a =sumif function with multiple criteria but I'm not sure how you would define the "date rage" for each new criteria

Categories : Excel

Jquery returns NaN with price
"#pricetag will be somelike like £40.00" You need to get rid of the £ in #pricetag before executing parseInt(). Something like this: var price = 'u00A3' + (parseInt($('#pricetag').text().replace(/u00A3/, ''), 10) * qty); parseInt() searches digits starting from the beginning of the string, and cuts the search at the first non-digit found. In your case the first character is £, so parseFloat() returns NaN, which produces NaN when used with *. EDIT What ever you have (or don't have anything) in front of the numbers in the #pricetag, you can use this to remove it: var price = 'u00A3' + parseInt($('#pricetag').text().replace(/^D/, ''), 10) * qty; Also notice, that you have to validate qty before using it within calculations. A live demo at jsFiddle.

Categories : Javascript

Regex for price in jQuery
You may want to take a look at my jQuery iMask plugin, though what you're asking for specifically: .replace( /.*?(d+)(?:.(d{1,2}))?.*/, function( rx, dollars, cents ){ cents = +( cents || 0 ); return (+dollars + (cents/((cents<10)?10:100))).toFixed(2); } ); If you just want to strip non-numeric numbers: .replace( /[^0-9.]/g, '' )

Categories : Javascript

Price discount by age function
Use the below function instead of your function: function TheFunction() { var d = new Date(); if (d.getFullYear()-document.formular.select.select3.value >= 20){ price = priceOne() + priceTwo() + priceThree() priceDiscount = (price)*(0.9); } else{ price = priceOne() + priceTwo() + priceThree() priceDiscount = price; } document.formular.priset.value = priceDiscount }

Categories : Javascript

Select list with price value and name
Set only value= with price seperated by : or any other char value="LE- light weight:50.25">LE- light weight</option> and on the review echo the option like so: if (!empty($_REQUEST['DriverShaft'])) { list($shaft, $price) = explode(":", $_REQUEST['DriverShaft']); echo "<div class='reviewItem'><span class='reviewTitle'>Shaft:</span>{$shaft}</div>"; echo "<div class='reviewItem'><span class='reviewTitle'>Price:</span>{$price}</div>"; } else echo ""; If you want that nobody can see the price not even in html sorce text add the ID of the DB table where the price is stored value="LE- light weight:12">LE- light weight</option> a database query is needed if (!empty($_REQUEST['DriverShaft'])) { list($shaft, $ID

Categories : PHP

beautiful soup getting tag or getting price
In the following code: foundPrice = soup.findAll('span', {'itemprop':'price'}) if found is not None: You assigned result of findAll to foundPrice, but if statement compare found. Try following: import urllib2 from bs4 import BeautifulSoup url = 'http://www.fastfurnishings.com/Aura-Floor-Lamp-p/lsi_ls-aurafl-gy-gn.htm' u = urllib2.urlopen(url) try: soup = BeautifulSoup(u) finally: u.close() span = soup.find('span', {'itemprop':'price'}) if span is not None: print span.string else: print 'Not found'

Categories : Python

Price input in Rails4
I think you have missed the :decimal in migration file Edit the migration again by this add_column :listings, :price, :decimal, :precision => 8, :scale => 2

Categories : Ruby On Rails

how can i echo item price in php
First, you need to have unit_price available in your $item array from the database. In your foreach loop, replace this line $text = $item['name']; with this: $text = $item['name'] . ' $' . number_format($item['unit_price'], 2); This is how the code should look: <head> <title><?php echo $this->lang->line('items_generate_barcodes'); ?></title> </head> <body> <table width='50%' align='center' cellpadding='20'> <tr> <?php $count = 0; foreach($items as $item) { $barcode = $item['id']; $text = $item['name'] . ' $' . number_format($item['unit_price'], 2); if ($count % 2 ==0 and $count!=0) { echo '</tr><tr>'; } echo "<td

Categories : PHP

.NET price format issue
The string from the web service is "599.00". If I Convert.ToDecimal(theString) I still get 599.00,00 when displayed in the datagrid output. If the string from the web service always uses a dot as decimal separator, convert using the InvariantCulture, which has a . as DecimalSeparator: decimal amount = Convert.ToDecimal("559.00", CultureInfo.InvariantCulture);

Categories : Dotnet

how to style in css: product...(price)?
http://jsfiddle.net/4QgtM/5/ try this i { border-bottom: 2px dotted; display: block; height: 1px; left: 0; line-height: 28px; padding: 2px 0; position: absolute; right: 0; top: 15px; vertical-align: bottom; z-index: 0; }

Categories : HTML

Sort an array by 'price' value
Remove quotes OR use numeric sort. String "24" is greater than "1834" because 2 is greater than 1. My solution $working[33] = array('id' => '33', 'price' => '250.00'); $working[34] = array('id' => '34', 'price' => '277.88'); $working[35] = array('id' => '35', 'price' => '1289.57'); $working[36] = array('id' => '36', 'price' => '15.42'); foreach ($working as $key => $row) { $price[$key] = $row['price']; } array_multisort($price, SORT_NUMERIC, $working); var_dump($working); Output array(4) { [0]=> array(2) { ["id"]=> string(2) "36" ["price"]=> string(5) "15.42" } [1]=> array(2) { ["id"]=> string(2) "33" ["price"]=> string(6) "250.00" } [2]=> array(2) { ["id"]=> string(2) "

Categories : PHP

How to extract value from a formatted price?
There are probably better ways to do this and I'll be the first to admit that my regex is pretty basic... String regExp = "\$[0-9,\.]+"; String value = "Executive billings @ $40,250.99 Starting 2013-01-05 with bi weekly"; Pattern pattern = Pattern.compile(regExp); Matcher matcher = pattern.matcher(value); // This should result in a list with 1 element of "$40,250.99" List<String> lstMatches = new ArrayList<String>(5); while (matcher.find()) { lstMatches.add(matcher.group()); } for (String match : lstMatches) { // Strip off the unrqeuired elements... match = match.replaceAll("\$", ""); match = match.replaceAll(",", ""); System.out.println(Double.parseDouble(match)); } You may even be able to use NumberFormat.getCurrencyInstance().parse(match) to parse t

Categories : Java

Price data modelling
Maybe I missed something but why not just add a column to your table, perhaps CURRENCY_TYPE, and have another table to be used for referential integrity so users can't put several values for the same currency (CAN, CANADIAN DOLLAR, etc) and you can store whatever information you may want to about the currency. You'll still need to do a join to the reference table for any information about the currency, but on the base table you'd have the price and it's currency type.

Categories : Misc

Separate price from text
I'd say : $price = array_pop ( explode(' ',$var) ); Once you have the price, you can remove the price from the initial string. or you could explode with the - sign.. but don't forget to remove the space in front of the price afterwards

Categories : PHP

how to get price in high to low order
You are ordering a "text" field, the result goes alphabetically. You need to cast as Int your price field: select * from product_tb where sub_id='"+bl.sub_id+"' order by CAST(price AS INT) desc

Categories : Asp Net



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.