update total not working on cart page for table rate shipping methods magento1.9 - magento-1.9

I have enabled table rate shipping method in magento. Now in cart page I am getting a section called Estimate Shipping and tax.
Now in this section when I am selecting a country and clicking on estimate then I get the shipping rate according to the tablerates.csv file that I have uploaded through magento admin panel in
System->Configuration->Sales->Shipping Method->Table Rates
section.Now when I select the rate and click on update total then total is not getting updated. This problem I have on my live site.
Then I installed magento on local and does the same process, here the total gets updated when I click on update total section.
Then I checked controller action for update total button. The action of the form that contains the button is
action="http://{{site-url}}/checkout/cart/estimateUpdatePost/"
Now when I compared the estimateUpdatePost action on local and live then found that content is same
Content of estimateUpdatePost action on localhost
public function estimateUpdatePostAction()
{
$code = (string) $this->getRequest()->getParam('estimate_method');
if (!empty($code)) {
$this->_getQuote()->getShippingAddress()->setShippingMethod($code)/*->collectTotals()*/->save();
}
$this->_goBack();
}
Content of estimateUpdatePost action on live
public function estimateUpdatePostAction()
{
$code = (string) $this->getRequest()->getParam('estimate_method');
if (!empty($code)) {
$this->_getQuote()->getShippingAddress()->setShippingMethod($code)/*->collectTotals()*/->save();
}
$this->_goBack();
}
Now both the function is same.I could not understand why the total is not getting updated on live. Could anyone help me proceed in right direction.

The problem was one of the modules. Enabling and disabling the modules got me know the module due to which update total was not working.

Related

Do not change the router values ​in the address

I have a page (index) with an #ActionLink that opens another page to edit an invoice, the page will appear correctly, but the [Url-address] shows the number for the invoice, and when I change the number for the invoice in the [Url-address], it means that he opened another invoice, and I want the modification page not to open from By modifying the [Url-address] or using a direct link, I found a nice way, but it is used with [Post] and not Get. Is there a way to protect the [Url-address] of the page from being modified and its values?
View Index:
#Html.ActionLink(
linkText: "Edit_Invoice",
actionName: "Invoice_Edit",
controllerName: "Invoice",
routeValues: new { ID_Invoice = 2 },
htmlAttributes: new { area = "Pro"})
Controller :
[HttpGet]
public ActionResult Invoice_Edit(int id_invoice)
{
Table.Invoice invoice = (from i in Cn.Invoice
where i.ID_Invoice == id_invoice
select i).FirstOrDefault();
return View(invoice;
}
View Invoice_Edit:
#Html.TextBoxFor(m => m.ID_Invoice)
#Html.TextBoxFor(m => m.Date_Invoice)
<button>save</button>
When you open the invoice modification page, its number will appear in the address as in the link below
https://localhost:44320/Pro/Invoice/Invoice_Edit?ID_Invoice=2
I only want to open invoices that are selected from the page only.
Update 1 : Change Title Answer
if you what users to open only invoices that they are allowed to open, antiforgery token has nothing to do with it. You neeed server side validation, authentication and authorization. All of these should be implemented on the server side. Client side javascript code is not enough.
Anti-Forgery Tokens don't make a lot of sense for any request where you're not modifying and persisting data. So I recommend to remove [ValidateAntiForgeryToken] from your GET since GET request will be returned to the user, not the attacker.
AntiForgeryToken is designed for POST requests and it expects the token in Request.Form collection. You can just use post instead of get to receive data. Or you can use ajax. Google and you will find some examples.
But make sure that you are using them when you're creating, updating or deleting data.

Magento 1 how to setup recurring payment initial fee on the fly?

I need to set recurring payment's initial fee during check out. So that I can charge customer the time when order is placed.
Does anyone know how or point me a direction? thanks
First of all, I need to make it clear that the recurring payment is made against paypal gateway shipped with default Magento. My solution is to twist a bit of method submitRecurringProfile resides in Mage_Paypal_Model_Pro.php. So I override it with MyCompany_ModuleName_Model_Paypal_Pro.php so that I can make changes to submitRecurringProfile without mess up the core file.
public function submitRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile,
Mage_Payment_Model_Info $paymentInfo
) {
$profile->setData('init_amount', 100);
parent::submitRecurringProfile($profile, $paymentInfo);
}
With about function in place, initial fee will be set to 100.

How to hide tax , shipping & handling from cart and checkout

I am using Magento version: 1.9.2.2
I want to hide tax, shipping and handling from cart and checkout page of my app but didn't get any success been trying from last two days.
Followed some solutions(links attached) from the forums and various Websites but not getting any success for this please help to find any solution for this.
links which I've followed for this:
didn't work:
https://magento.stackexchange.com/questions/31603/how-to-remove-tax-from-cart-page,
https://magento.stackexchange.com/questions/54375/how-do-i-remove-total-excl-tax-from-cart-review-page
almost done the trick but tax appeared as soon as I logged in https://magento.stackexchange.com/a/63352 ,
Worked for a short period of time tax magically reappeared after some time
http://michaelsavin.com/magento-hide-tax-summary-from-cartcheckout/
Open admin panel, go to system > configuration > sales > tax > order, Invoices, Credits Memos display settings
then set Display full Tax Summery : No

Magento migration from 1.9.1.0 to Magento 2 doesn' show product in front end

I have installed Magento 1.9.1.0 with sample data, without error. After that installed magento 2x without error. Then i migrate content from 1.9.1.0 to 2x with data migration tool, and it completed. Products and almost all informations are migrated, and i can see product in Admin side. But couldn't visible for other users.It showing 'We can't find products matching the selection.'. What would be the problem???
To show the product, check if the product following options:
General->Status = Enabled
general->Visibility = Catalog,Search
Inventory->Qty > 0
Inventory->Stock Availability = In Stock
Websites = checking your site
Catgories = checking your category.
If you want checking product to subcategory, go to Catalog->Manage Categories->Select your category, open tab Display Settings and change option "Is Anchor" to "Yes". Save category

Creating a URL that will randomize at intervals and remove access to past URLs

Okay, I know this question has been half answered around here, but I'll explain in full and see if there maybe a better way to handle this then in just two parts.
I'm building an HTML5 voting site, that will close voting every half hour. And then open a new batch of voting.
What I need to do, is have the URL of this site be 'masked' ie:
have a random URL for it be generated that leads to the same location- so say I'm directing users to voting.com, I want them to only access it via the url votingstuff.com/hg67, and have that end portion be changed every half hour- and once the new url is generated, remove access to the site via the old URL.
I might add that after the user votes, I'd also like to close their voting access until the new URL is posted. AKA- everyone only gets one chance to vote.
Thoughts? Libraries to check out? Sites that do this? I know the randomization has been answered a few times, but usually it's a generator led to by a page, I want to START with a randomly generated URL, and not have a page that creates it as a function. I may have to write code that generates the page I guess?
Here is an approach I can think of -
You don't need to handle multiple URL's, you can achieve this on the same URL itself by enabling/disabling access to the URL content every hour.
You will need some action on your application/server side as well. For reference lets assume you have a PHP server running. You will need some table that holds a status setting for you, something like this -
Settings Table
id settingCode value
=============================
1 votingOpen 1
You will also need to setup a cron job on your server that will run every half an hour. The cron job's task would be to run every half an hour & change the value of the votingOpen to its inverse. So assume open your votings, initial value of the votingOpen field would be 1 i.e the first half an hour of voting starts.
Along with this you will start the cron job as well. Now what will happen is that after half an hour the cron job will fetch the value of votingOpen read it & if its 1, it will change it to 0 & if its 0 it will change it to 1. This will happen every half an hour on your server.
Now you need to make this votingOpen variable accessible on your client side code using a simple query to fetch its value. On each render of your voting page, on top somewhere you can check this value & if its 1 i.e true, you will write the logic to go ahead & show the voting page. But if its 0, you can redirect the user or show a different message on that page.
Lets say your voting happens on http://somedomain.com/voting, on the render logic of this page you can do something like this -
Voting View Logic
<?php
$votingOpen = {some database query that fetches the value from the database};
if($votingOpen) {
// your voting view resides here
} else {
// either redirect user to some other page
// or show some message like voting is closed on this same page.
}
?>
Limit multiple votes from one person
Normally the best way to handle this is a combination or registered user only vote + cookie/localStorage + IP tracking
But if you don't have registered user voting, you can still capture IP of user & allow only one vote per IP and you can also set a cookie or a localStorage variable in the users computer so he can only vote once.
Hope this helps.
Ref for Cron Job - http://code.tutsplus.com/tutorials/managing-cron-jobs-with-php--net-19428