texts: I want to update the cart data not only item and options, I have aw_sarp_subscription_type in cart, that I want to update when customer click the update button. Please help me.


texts: Magento 2 - Get Value of Attribute Set in Cart

texts:
How do I calculate the total value of products in the cart belonging to a specific attribute set?
I need to disable the checkout and 'Proceed to Checkout' link if the total value of products in the cart, belonging to a specific attribute set is below a certain amount.


texts: Improving error messages for XML compilation errors

texts:
Magento is fairly protective (as it should be) regarding the display of errors. When developer mode is enabled (as it should be during development), the application allows runtime error feedback to bubble up to the user. For XML compilation errors though this feedback is fairly useless:

  Fatal error: Uncaught exception 'Exception' with message 'Warning: simplexml_load_string(): Entity: line 4: parser error : XML declaration allowed only at the start of the document  in [...]/lib/Varien/Simplexml/Config.php on line 510' in [...]app/code/core/Mage/Core/functions.php on line 245

This results from Varien_Simplexml_Config::loadFile() presenting ::loadString() with a string which cannot be parsed:

public function loadFile($filePath)
{
    if (!is_readable($filePath)) {
        //throw new Exception('Can not read xml file '.$filePath);
        return false;
    }

    $fileData = file_get_contents($filePath);
    $fileData = $this->processFileData($fileData);
    return $this->loadString($fileData, $this->_elementClass);
}

There are several potential solutions, including using libxml_use_internal_errors, but the calling method does not communicate the $filePath param, so context would be lost. One possibility would be to throw a more explicit exception:

public function loadFile($filePath)
{
    if (!is_readable($filePath)) {
        //throw new Exception('Can not read xml file '.$filePath);
        return false;
    }

    $fileData = file_get_contents($filePath);
    $fileData = $this->processFileData($fileData);
    try{
        return $this->loadString($fileData, $this->_elementClass);
    }
    catch (Exception $e){
        Mage::throwException (
            sprintf(
                "%s: error parsing %s:\r\n%s",
                __METHOD__,
                $filePath,
                $e->getMessage()
            )
        );
    }
}

This at least provides output like the following:

  Fatal error: Uncaught exception 'Mage_Core_Exception' with message 'Varien_Simplexml_Config::loadFile: error parsing [...]/app/code/local/Some/Example/etc/config.xml: Warning: simplexml_load_string(): Entity: line 4: parser error : XML declaration allowed only at the start of the document in [...]/lib/Varien/Simplexml/Config.php on line 534' in [...]/app/Mage.php on line 594

Are there some advantages/disadvantages/alternate approaches to consider here?


texts: Magento 1.9.3.4 "Proceed To Checkout" button disappears after disabling Onepage Checkout

texts: I have inherited the maintenance of a Magento 1.9.3.4 site that currently has Onepage Checkout enabled.  The owner wants to remove it, but when I disable, the Proceed to Checkout buttons disappear from the Cart page.  I have searched around and haven't found any solutions that fix my problem.


texts:
I am facing trouble to print query while saving data from my controller file.

I am developing a custom module where I am required to save current date and time when form is submitted. The user is not inputting the date.

$timeStamp = date("Y-m-d H:i:s");
$model->setCreatedTime(Mage::getModel('core/date')->gmtDate(null, $timeStamp ));
$model->save();

Here when I print my $model->getData(); I see created_time value but its not reflecting in DB

Also I tried with below code to print SQL query but it says Call to a member function printLogQuery() on a non-object.

// For printing the whole SQL with the Collection
var_dump($model->printLogQuery(true));

// For printing only the SQL
var_dump($model->__toString());

How can I print INSERT query for above scenario ?

Pls help

Thanks


texts: Where I get download link to download magento2.0.0 community edition?

texts:
In my current project, we use magento 2.0.0 community edition. Now I see many core files are modified by previous developers. But to identify those core file I need original magento 2.0.0 community edition package. But, now it is not available for download from magento.com site.

If any one give me the download link from any site to download original magento 2.0.0 community edition, or if any one have this package with his/her then if you share that package with me I shall ever remain grateful to you.


texts: Magento 2: How/Where is the `getTemplate` Knockout Function Bound?

texts:
Many Magento backend pages contain the following in their source code

<!-- ko template: getTemplate() --><!-- /ko -->

I understand (or think I do?) that <!-- ko template is a KnockoutJS container-less template binding.

What's not clear to me is -- what context is the getTemplate() function called in?  In the examples I've see online, there's usually a javascript object after the template:.  I'm assuming that getTemplate is a javascript function that returns an object -- but there's no global javascript function named getTemplate.

Where is getTemplate bound?  Or, possibly a better question, where does the KnockoutJS application binding happen on a Magento backend page?

I'm interested in this from a pure HTML/CSS/Javascript point of view.  I know Magento 2 has many configuration abstractions so (in theory) developers don't need to worry about the implementation details.  I'm interested in the implementation details.


texts: 404 not found Error in Magento Connect Manager

texts:
I want to use magento connect to install a Extension. I am receiving a 404 Cms page when i try to open it.

I tried to

delete the files from var/cache
Change permission of Directory /downloader/ set to 755 and file downloader/index.php set to 644. This method works for me .


texts: not able to install B2B extension for magento 2.2.0

texts:
I m using Magento 2.2.0 and trying to install B2B extension via composer require.

[InvalidArgumentException]
  Could not find package magento/extension-b2b at any version for your minimum-stability (stable). Check the package spelling or your minimum-
  stability

I used following link.

http://devdocs.magento.com/guides/v2.2/comp-mgr/install-extensions/b2b-installation.html


texts: The website says the requirement is MySQL 5.6. For some reason my server has to run MySQL 5.5. Will there be any problem to run Magento 1.9.1 on MySQL 5.5? Please advise. Thanks.


texts: How to override protected function Magento 2?

texts:
i want to edit this function in Magento\Eav\Model\ResourceModel\Entity\Attribute.php

protected function _updateDefaultValue($object, $optionId, $intOptionId, &$defaultValue)
{
    if (in_array($optionId, $object->getDefault())) {
        $frontendInput = $object->getFrontendInput();
        if ($frontendInput === 'multiselect') {
            $defaultValue[] = $intOptionId;
        } elseif ($frontendInput === 'select') {
            $defaultValue = [$intOptionId];
        }
    }
}

I want to check if $ frontendInput == 'checkboxes'
I have override this file but can't. who knows any other way?
Please helpe me! tks.

this is my code

class Attribute extends \Magento\Eav\Model\ResourceModel\Entity\Attribute{

protected function _updateDefaultValue($object, $optionId, $intOptionId, &$defaultValue)
{
    if (in_array($optionId, $object->getDefault())) {
        $frontendInput = $object->getFrontendInput();
        if ($frontendInput === 'multiselect' || $frontendInput === 'checkboxs') {
            $defaultValue[] = $intOptionId;
        } elseif ($frontendInput === 'select' || $frontendInput === 'radio') {
            $defaultValue = [$intOptionId];
        }
    }
}}


texts: Checkout cart suddenly is not working anymore

texts:
In the middle of the day after 2 months without deploying anything, my Magento 2 cart is not working, everyone that tries to go to the cart account sees an error 500, my server said it's probably a module since they aren't able to see anything weird from their side.
These are the issues that I got in my logs.


texts: UpdateAttribute for Created_at, but where can i find created_at?

texts:
I have an extension with this installer script

$prodEntityTypeId = $installer->getEntityTypeId('catalog_product');
$installer->updateAttribute($prodEntityTypeId, 'created_at', 'frontend_label', 'Date');
$installer->updateAttribute($prodEntityTypeId, 'created_at', 'used_for_sort_by', 1);

The about script seems to make created_at attribute to be used_for_sort_by, but

where is the created_at attribute?
does this attribute exist in a fresh magento install?

I can't find in magento backend.


texts: Convert normal mysql query with math functions into magento model format

texts:
I have the following query in MySQL. I need to convert it for magento.

My query is,

SELECT latitude, longitude, SQRT(
    POW(69.1 * (latitude - [startlat]), 2) +
    POW(69.1 * ([startlng] - longitude) * COS(latitude / 57.3), 2)) AS distance
FROM TableName HAVING distance < 25 ORDER BY distance;

I know how to use addFieldToFilter() for a single column and multi-column. but this is little confusing me.


texts: Magento 2: how to use a configuration field for the crontab expression?

texts:
In Magento 1, instead of declaring the cron expression directly like this:

<crontab>
    <jobs>
        <vendor_module_cron>
            <schedule>*/30 * * * *</schedule>
            <run>
                <model>module/observer::runCron</model>
            </run>
        </vendor_module_cron>
    </jobs>
</crontab>

you could setup your crontab like this in the config.xml:

<crontab>
    <jobs>
        <vendor_module_cron>
            <schedule>
                <config_path>vendor/module/cron_expr</config_path>
            </schedule>
            <run>
                <model>module/observer::runCron</model>
            </run>
        </vendor_module_cron>
    </jobs>
</crontab>

Where Magento would use Mage::getStoreConfig((string)$jobConfig->schedule->config_path) to get the cron schedule expression.

This way you could dynamically change the schedule from the backend without having to modify the config.xml file directly.

How can we achieve this in Magento 2 ? Is it still possible ?


texts: Remove login on the checkout if the email is already registered

texts:
Currently at the checkout, if you enter an email that has already been registered in the system, Magento ask you to enter your password.

This is a problem because many customers don't remember their passwords.

How could I remove this login from the checkout? (i.e even if the email has been used before, allow to checkout normally without needing to log in)


texts: Products won't show up on my website! (search, catalog, categories)

texts:
Since today, my products have stopped displaying on the website! I don't remember making any changes to .xml, .phtml files. I have already gone through checking the stock, inventory, enabled, visibility, cache, index and so on. But they still won't show up.

I can still navigate to the products with the url-key. Also, noteworthy is that when I search for the products using search or advanced search, it comes up with results, but it just won't display it. Please see the screenshots below to understand the issue.

EDIT: Also, both search and advanced search seem to break the page i.e  the footer doesn't show up too.

Case 1

However, when searching for a "hot huez" (name of a product), which matches the title of the product, it returns with what I believe to be the results without the actual product?

Case 2 (advanced search)

The advanced search even acknowledges that there is a product matching the criteria, but still doesn't display it. I'm at my wit's end, does anyone have any idea, what I might be missing?

Any help is greatly appreciated!


texts: Catalog Price Rule applied to wrong category

texts:
I have set up only one catalog price rule. It's outlet discount, which should be applied to onyl one category. When I check in frontend, this price rule is also applied to some other product that not belong to selected category, but have same parent category. How can I set up rule, that will apply only and only one category?

The rule is:

  If ALL  of these conditions are TRUE:
      Category  is  60


texts: Get individual products from bundled product on a order

texts:
I have a bundle product and it has been ordered, so in the admin backend, the order looks like this:

How can I get to the individual skus & qtys on this bundle products?

For example, from this order, I would like to retrieve:

ACULSML x 1
ACPS x 1
ACFP x 1

So, I tried the following based on this answer:

$order_items = $order->getItemsCollection();
foreach ($order_items as $order_item) {
    $qtyOrdered = intval($order_item->getQtyOrdered());
    $rowTotal = floatval($order_item->getRowTotal());
    if ($order_item->getProductType() === 'bundle') {

        $store_id = $order->getStoreId();
        $product = Mage::getModel('catalog/product')->setStoreId($store_id)->load($order_item->product_id);
        $options = Mage::getModel('bundle/option')->getResourceCollection()
                              ->setProductIdFilter($order_item->product_id)
                              ->setPositionOrder();
        $options->joinValues($store_id);
        $selections = $product->getTypeInstance(true)
            ->getSelectionsCollection($product->getTypeInstance(true)
            ->getOptionsIds($product), $product);
        foreach ($options->getItems() as $option) {
            $option_id = $option->getId();
            foreach ($selections as $selection) {
                if ($option_id === $selection->getOptionId()) {
                    echo $selection->getSku() . " x ". $selection->getSelectionQty() ."\r\n";
                }
            }
        }
    }
    else
    {
        // snipped
    }
}

The above code doesn't seem to be working, because it is generating the following output:

ACULSML x 1.0000
ACFGSML x 1.0000
ACGLSML x 1.0000
ACLBSML x 1.0000
ACLSML x 1.0000
ACMGSML x 1.0000
ACDBSML x 1.0000
ACTGSML x 1.0000
ACCSML x 1.0000
ACDCSML x 1.0000
ACFP x 1.0000
ACPSL x 1.0000

Any idea what might be wrong? How do you get to the individual item on a bundle off an order line?


texts:
I have just installed Magento 2.3, hosting on local server us XAMPP, i get the following message when i try to log on to admin.

  Fatal error: Namespace declaration statement has to be the very first
  statement or after any declare call in the script in
  C:\xampp\htdocs\magento\vendor\magento\framework\View\Element\Template\File\Validator.php
  on line 2

My code in the file reads <?php namespace
I have no white space before


texts: magento fooman css/js combine + minify & using CDN

texts:
We added a CDN just recently. And this got me wondering. We use fooman extension to combine + minify all CSS and JS ...

but these files are on the original server (not CDN)

Ofcourse the CDN replicates - but I was wondering if this is actually good practice. Or if this should work differently if using a CDN


texts: How to dynamically change attribute value depending on the selected swatch or size?

texts:
I have a table in which I want to display product attribute data there, depending on the selected size or swatch.

So that the value of the attributes in the table changes dynamically

How to dynamically retrieve this data when clicked?


texts: Can we implement group order functionality In Magento 2.3.x

texts:
Here is an example of the functionality :

https://www.bigbelly-cluj.ro/ShoppingCart/GroupOrder?CultureID=2&CultureUrl=en

So I want to create a group order functionality which enables initiator user to create an order and then share that order with his/her friends so his/her friends can also add their products to cart and everyone will contribute to cart individually and order will be placed at last by the initiator, and each user will get their share amount of pay with individual share invoice. any help will be appreciated, thanks.


texts: Login into magento from outside of magento without ruining $_SESSION

texts:
I am trying to integrate an external site with magento, so that when a user logs into site A, magentos session cookie gets set.

Currently I am doing this:

<?php
$email = $_POST["email"];
$password = $_POST["password"]; // not the same as magento password

//Validation.... sets that user is logged in in $_SESSION
session_start();
//login writes to $_SESSION
$success = login($username, $password);

if(!$success)die("Wrong credentials");
require_once("/path/to/mysite/magento/app/Mage.php");
Mage::app("default");
Mage::getSingleton('core/session', array('name' => 'frontend'));
$customer = Mage::getModel("customer/customer");
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
$customer->loadByEmail($email);
$session = Mage::getSingleton("customer/session");
$session->loginById($customer->getId());
$session->setCustomerAsLoggedIn($customer);

//User is now logged in, redirect somewhere else
header("Location: home.php");

the problem is if I write to the session before magento starts it's magic, magento won't write to its cookie, and if I start magentos session before validation I can no longer write to $_SESSION and have it persist to the next (non-magento) page.

So, is there any way I can log a user into magento from outside magento, and not ruin my session?


texts: Get MAGE_MODE within a template file or a block

texts: How can I get the current MAGE_MODE value, defined in the env.php file, from a template (.phtml) file or a block class?


texts: Magento 2.3 How to get Quote Data on product detail page

texts:
i want to get this quote data on product page but that not return any data ... only return below array instead of all quote data

On other page it working fine issue only on product page.

array(4)
{

    ["is_checkout_cart"]=>
    bool(true)
    ["store_id"]=>
    int(1)
    ["remote_ip"]=>
    string(15) "106.201.234.169"
    ["x_forwarded_for"]=>
    NULL
}

Here is my code

<?php
namespace Vendor\Base\Helper;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\ScopeInterface;
use Magento\Checkout\Model\Session;
class Data extends AbstractHelper {
    protected $scopeConfig;
    protected $session;
    protected $priceHelper;
    public function __construct(Context $context,Session $session,\Magento\Framework\Pricing\Helper\Data $priceHelper) {
        parent::__construct($context);
        $this->scopeConfig = $context->getScopeConfig();
        $this->session=$session;
        $this->priceHelper=$priceHelper;
    }
    public function getCheckoutData(){
        $data_array=array();
        $checkout_data=$this->session->getQuote();
        var_dump($checkout_data->getData());exit;

    }
}

anyone have idea whats wrong in my code?


texts: Braintree and Kount (GENE version 2.2.3) installation on Magento ver. 1.14.0.1

texts:
I'm trying to configure ENS via a Braintree, Kount, Magento workflow, and  are experiencing errors that i'm unable to diagnose.

Here's what I'm doing:
Order # 100096149 | Jan 8, 2018 3:51:07 PM (random order number)

This order number above is in payment review.

I head over to https://awc.test.kount.net/workflow/queue.html and login: Workflow > Suspect Orders.

Then I check the order in question and select the drop down box and mark as approve, leave a comment if necessary and then Submit. After that the order disappears out of the kount menu.

When I go back to magento Sales > Orders I see my order but it still has a "payment review" status.

I believe it's suppose to utilize this frontend URL to locate and parse some order status xml in addition to the api but i get an error page.

There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 289481254204

That URL which errors is: https://this.yourstore.com/index.php/braintree/kount_ens/

In their documentation it says "This URL must be publicly accessible for the ENS to function correctly."

I believe this may be the problem. When i check the specific report number, i get this:

a:5:{i:0;s:20:"Invalid ENS request.";i:1;s:975:"#0 /var/www/html/ecommerce-us-ca-rev328/app/code/community/Gene/Braintree/controllers/Kount/EnsController.php(33): Mage::throwException('Invalid ENS

req...')

#1 /var/www/html/ecommerce-us-ca-rev328/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Gene_Braintree_Kount_EnsController->indexAction()

#2 /var/www/html/ecommerce-us-ca-rev328/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')

#3 /var/www/html/ecommerce-us-ca-rev328/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))

#4 /var/www/html/ecommerce-us-ca-rev328/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()

#5 /var/www/html/ecommerce-us-ca-rev328/app/Mage.php(684): Mage_Core_Model_App->run(Array)

#6 /var/www/html/ecommerce-us-ca-rev328/index.php(88): Mage::run('usa_en', 'store')

#7 {main}";s:3:"url";s:21:"/braintree/kount_ens/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:6:"usa_en";}

EnsController.php - line 33

 // Validate the IP address of the request
        if (!$ens->isValidEnsIp($http->getRemoteAddr())) {
            Gene_Braintree_Model_Debug::log('Invalid IP for ENS request: ' . $http->getRemoteAddr());
            Mage::throwException('Invalid ENS request.');
        }

Here's what I've tried so far:

Actions - Here's what I've tried:

I've worked through all the error logs including system.log,
execption.log and braintree.log ensuring there are no errors or
restrictions
I've whitelisted all IP's and cleared all rules with our firewall to
ensure there is nothing blocking us there.
I've tried using the IP instead of the URL for the ens URL:
https://exactIpAddress/braintree/kount_ens/
Created new API keys
Checked user permissions

Need help, thank you.


texts: How to add new css file for custom theme in Magento2

texts: I have to add new css file for custom theme in magento 2. will anyone please tell me how to add.


texts: Magento2 - Why would Magento Test Framework - Integration tests fail on a clean composer install

texts:
Firstly as I'm using Magento Enterprise I don't think I can pull against a git repository where I know the tests are passing. I presume that these are being run in travis-ci.com rather than .org

Secondly I'm not sure I would want to anyway, as the github repro's have all the code in /app/code rather than /vendor.

So because I want to start to build out my Continuous Integration Pipeline, I follow the below steps:

Install EE v2.1.7 using composer
Commit to private git repository
Connect private repository to private travis-ci.com account
Edit .travis.yml to add encrypted credentials
Edit .travis.yml to give correct execute permissions on: ./dev/travis/before_install.sh and ./dev/travis/before_script.sh

before_install:
  - chmod +x ./dev/travis/before_install.sh
  - ./dev/travis/before_install.sh
install:
  - echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > auth.json
  - composer install --no-interaction --prefer-dist
before_script:
  - chmod +x ./dev/travis/before_script.sh
  - ./dev/travis/before_script.sh

Commit and Push to git
Check build at travis-ci.com

Expect Result - build passes
Actual Result - build fails

As I said above the community git repository has the code in /app/code are they only running tests from an /App/code setup? Is there some compatibility issue here from running them from the vendor folder.

I'm getting numerous. PHP Fatal error:  Uncaught exception 'Exception' with message 'Asymmetric transaction rollback.' As pointed out here "Asymmetric transaction rollback error" in integration test this is a false error message as it means that an exception has been re-thrown in the commit callbacks - meaning that the true error message is lost.

One true stack trace is:

There was 1 error:
1) Magento\Customer\Model\GroupManagementTest::testGetDefaultGroupWithNonDefaultStoreId
Magento\Framework\Exception\NoSuchEntityException: No such entity with groupId = , storeId = 5

Why would a clean install fail? - presumably the core-team's travis file has the correct set up to create environments for passing tests?
And presumably they have actually run these tests?

I am really hoping this is environmental. I don't want to be digging around in the core looking for core bugs - I want to start with a nice clean build before I start adding stuff...

Any ideas?


texts: Magento 2 : Cookie Security: HTTPOnly not Set for customer id

texts:
While Customer login in magento 2 system . We are setting cookie against Customer and cookie has been set but when are checking cookie in browser location where HTTPONLY is showing False that reason Fortify security scan has raised security concern.

More details please, find below attached screen-shot.

If anyone have idea then please help out.


texts: Magento API 20x Slower On Local Dev Environment. Why?

texts:
I'm trying to test the speed of Magento API methods and finding it very difficult due to inconsistent results.  Right now my test consists of three API calls:  login, core_magento.info, and endSession.  When I query my development server, here are the (approx. average) response times I get for each method via XML-RPC, SOAP, and SOAP with WSDL cache enabled:

Method              XML-RPC     SOAP     SOAP w/WSDL cache
login               0.35s       0.30s      0.20s
magento_core.info   0.30s       0.25s      0.18s
endSession          0.25s       0.20s      0.16s

When I duplicated this test on my local environment I got wildly different results with each API call taking over 20 times longer.  It does make the WSDL cache look like a big win, though!

Method              XML-RPC     SOAP    SOAP w/WSDL cache
login                10.3s      10.3s     5.18s
magento_core.info    10.3s      10.3s     5.18s
endSession           10.3s      10.3s     5.16s

I found this very strange since my local machine is pretty powerful and I've given Magento (PHP & MySQL really) lots of resources.  Page load times are similar locally to the dev server.  Through additional testing with a default Magento install I found that removing php_flag zlib.output_compression on from my .htaccess file improved things in some cases, but not all:

Method              XML-RPC     SOAP    SOAP w/WSDL cache
login                10.3s      10.3s      5.18s
magento_core.info    10.3s       5.3s      0.18s
endSession           10.3s       5.3s      0.16s

At this point with the WSDL cache enabled, I'm getting very similar response times locally and on the dev server for the magento_core.info, and endSession calls.  Without the cache though, things are still an order of magnitude slower locally, and the login method is slow even with the cache.

So I'm trying to figure out what is different about my local environment to cause such different results?  If it was simply two times slower across the board I wouldn't think much of it, and just factor that into my testing. The size of the difference, and the inconsistency is disconcerting though.  I'm hoping someone experienced with the Magento API can weigh in on this.

Yes I certainly could just test on the server, but I really want to get my local environment to match server behavior.  Seems like a good idea, right?


texts: Creating Magento-attributes using Magento-Extension

texts:
Need help to create Magento attributes using Magento Extension.
Here are the instructions:

I have to create a new Yes/No attribute for products. The code should be display_product.

The code should be able to install in Magento extension because I will use git and host the code in github.

Thanks.


texts: Can't upgrade to 2.2.3 from 2.2.2. Memory limit reached

texts:
I'm trying to upgrade my Magento installation but experiencing problems with the process:

I was trying to update my site to the latest release as advised and I did so via the command line but I ran out of memory trying to do so.

Commands I ran were:

composer require magento/product-community-edition 2.2.3 --no-update
composer update

It was running fine but then a fatal error occurred:

Updating magento/magento2-base (2.2.2 => 2.2.3): Downloading (90%)
mmap() failed: [12] Cannot allocate memory

mmap() failed: [12] Cannot allocate memory

Fatal error: Out of memory (allocated 848302080) (tried to allocate 14680096 bytes) in phar:///usr/local/bin/composer.phar/src/Comp

Any ideas as my RAM allocation is fixed to 768? (I tried boosting it already).
I'm trying to upgrade to 2.2.3 from 2.2.2.

Thank you so much for any advice you may have.


texts: how to apply catalog price rules in magento by observer?

texts:
i need to create price rule by programmatically with help of Observer

and i want to know that which event call for this


texts: How do I set up USPS shipping labels in CE 1.7?

texts: I've created my USPS account, entered my info in the admin panel through System > Config > Shipping Methods > Usps, but when I select an order to ship I'm unable to create shipping labels. I can't find any documentation on what (I assume) is a simple task. Any idea what I'm doing wrong?


texts:
I am looking a way how can I change homepage route on specific customer group user login.
So basically problem that specific customer groups when logged in must see a different home page. How can this be done using events and observers. Also restrict that view only to that customer group. Is there a way to do that?


texts: Consistent 403 Error from REST API on v 1.9.3.2

texts:
The Setup
I've been through every post I can find on this and still no luck. I've got code for authorizing with and connecting to the REST API. In a test environment running 1.9.1.1 this all works flawlessly, in production running 1.9.3.2 it's always getting a 403.
What I've Tried
I've been over the configuration multiple times, the roles and permissions are configured correctly, everything is the same, yet it always fails in production.
Other Info
The company maintaining the server are sure the request is being handled by Magento, and one curious thing I have noticed is that if I omit part of the authorization header in test it'll tell me:
{"error":[{"code":401,"message":"oauth_problem=parameter_absent&oauth_parameters_absent=oauth_signature_method"}]}}

In production the only response I ever get back when hitting a valid URL is:
{"messages":{"error":[{"code":403,"message":"Access denied"}]}}

The only other difference is that production forces HTTPS, while in the test environment there's no valid cert and so I have to use HTTP.


texts: How to set up a custom variable in custom Adminhtml form and then parse it to the Observer

texts:
I am working on a custom Magento extension. Version: 1.9.0.1.

I have a custom Adminhtml form, here it is:

Here is the Form code:

<?php

class VivasIndustries_SmsNotification_Block_Adminhtml_Sms_Status_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
    {

        protected function _prepareForm()
            {
            $form = new Varien_Data_Form(array(
                                    'id' => 'edit_form',
                                    'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
                                    'method' => 'post',
                                 ));

                $fieldset = $form->addFieldset('edit_form', array('legend'=>Mage::helper('smsnotification')->__('SMS Information')));

                $statuses = Mage::getResourceModel('sales/order_status_collection')
                    ->toOptionArray();

                $statuses = array_merge(array('' => ''), $statuses);

                $fieldset->addField('state', 'select',
                    array(
                        'name'      => 'state',
                        'label'     => Mage::helper('smsnotification')->__('Order Status'),
                        'class'     => 'required-entry',
                        'values'    => $statuses,
                        'required'  => true,
                    )
                );

                $fieldset->addField('smstext', 'textarea', array(
                          'label'     => Mage::helper('smsnotification')->__('SMS Text'),
                          'class'     => 'required-entry',
                          'required'  => true,
                          'name'      => 'smstext',
                          'onclick' => "",
                          'onchange' => "",
                          'after_element_html' => '
SMS text must NOT be longer then 160 characters!',
                          'tabindex' => 1
                        ));

                if ( Mage::getSingleton('adminhtml/session')->getsmsnotificationData() )
                    {
                        $form->setValues(Mage::getSingleton('adminhtml/session')->getsmsnotificationData());
                        Mage::getSingleton('adminhtml/session')->setsmsnotificationData(null);
                    } elseif ( Mage::registry('smsnotification_data') ) {
                        $form->setValues(Mage::registry('smsnotification_data')->getData());
                    }
                // Add these two lines

                $form->setUseContainer(true);
                $this->setForm($form);

                ////

                return parent::_prepareForm();
            }
    }

I use this code to get the customer name from the order:

$CustomerName = $observer->getOrder()->getBillingAddress()->getName();

How can i check the whole text and if it finds CustomVariable_CustomerName to replace it with the real customer name ?

Thanks in advance!


texts: Magento 2.2.5 - How to increase the quality of product view photos JPG

texts:
I'm using Magento 2.2.5
How to increase the quality of product view photos JPG
Because in product view the JPG quality is not high, but link out to see the photo is high quality.
How to fix it?
Please help.


texts:
We have a Magento 1.9.3 site that only has configurable items on it.
On the list page, we need to check if the item is in stock, the way we're doing this is by checking if($_product->isSaleable()) but in the foreach loop this is adding quite some load time (about .2 seconds per configurable item)

Is there a better way we can check if the item is in stock?
Because we're dealing with configurable items, what we're really trying to find out is if any of the children items are still in stock and thus the item is saleable.
If all the children items are out of stock the we just add a label that says out of stock


texts:
i want to add search field here where records shows up

grid.php

<?php
namespace Vendor\Module\Block\Adminhtml\Sales\Mycustomreport;
class Grid extends \Magento\Reports\Block\Adminhtml\Grid\AbstractGrid

{
    protected $_columnGroupBy = 'period';
    protected function _construct()
    {
        parent::_construct();
        $this->setCountTotals(true);
    }
    public function getResourceCollectionName()
    {
        return \Vendor\Module\Model\ResourceModel\Report\MyCustomReport\Collection::class;
    }
    protected function _prepareColumns()
    {
        $this->addColumn(
            'period',
            [
                'header' => __('Interval'),
                'index' => 'period',
                'sortable' => false,
                'period_type' => $this->getPeriodType(),
                'renderer' => \Magento\Reports\Block\Adminhtml\Sales\Grid\Column\Renderer\Date::class,
                'totals_label' => __('Total'),
                'html_decorators' => ['nobr'],
                'header_css_class' => 'col-period',
                'column_css_class' => 'col-period'
            ]
        );

        $this->addColumn(
            'product_sku',
            [
                'header' => __('SKU'),
                'index' => 'product_sku',
                'type' => 'string',
                'sortable' => false,
                'header_css_class' => 'col-product',
                'column_css_class' => 'col-product'
            ]
        );

        $this->addColumn(
            'product_name',
            [
                'header' => __('Product'),
                'index' => 'product_name',
                'type' => 'string',
                'sortable' => false,
                'header_css_class' => 'col-product',
                'column_css_class' => 'col-product'
            ]
        );

        if ($this->getFilterData()->getStoreIds()) {
            $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
        }

        $this->addColumn(
            'qty_ordered',
            [
                'header' => __('Order Quantity'),
                'index' => 'qty_ordered',
                'type' => 'number',
                'total' => 'sum',
                'sortable' => false,
                'header_css_class' => 'col-qty',
                'column_css_class' => 'col-qty'
            ]
        );

        $this->addExportType('*/*/exportMyCustomReportCsv', __('CSV'));
        $this->addExportType('*/*/exportMyCustomReportExcel', __('Excel XML'));

        return parent::_prepareColumns();
    }
}

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Reports\Model\ResourceModel\Refresh\Collection">
        <plugin name="vendor_module_report_mycustomreport" type="Vendor\Module\Plugin\Magento\Reports\Model\ResourceModel\Refresh\Collection" sortOrder="1" />
    </type>

    <type name="Magento\Reports\Controller\Adminhtml\Report\Statistics">
        <arguments>
            <argument name="reportTypes" xsi:type="array">
                <item name="mycustomreport" xsi:type="string">Vendor\Module\Model\ResourceModel\Report\MyCustomReport</item>
            </argument>
        </arguments>
    </type>
</config>

note:- am not using ui component


texts: Retrieve information of update query magento

texts:
I need to retrieve information of:

$query = 'update customer_entity set is_active=1 where email = "'.$email.'";';
$results = $writeConnection->query($query);

If print the value of $results i have a big result, but for example if I execute this query in mysql I have something like this:

Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

How can I get the information of query?.

Thanks.


texts:
Hi I am trying to implement add extra key to base url
example
my base url:: abcd.com
if user click on any key with base_url like below
user entered url :: pawan.abcd.com site need set new theme if pawan key found my custom table. If not fount i need to redirect to home page or base url means site will work regular format if key found only new theme will assign
can you please tell how can achieve this.

Present my site abcd.com if i click pawan.abcd.com it redirecting to abcd.com
i am not redirecting but it redirecting automatically i have installed wild card ssl like *.abcd.com

can any one tell how to stop that automatic redirection


texts: How can I set the minimum order value included tax

texts:
I configured a minimum order value of 15€ in the magento backend, but it seems that this value is not involve the tax, so if I add a product to the cart which costs 17€ I get the message that the minimum order value is not reached :(.

How can I fix this, so that the minimum order value containing the tax?


texts: Product collection and Product Repository return different results

texts:
I am a little confused about the difference between getting products by Collection and use de Repository. Right now, in one project, if I run this code:
$collection = $this->_productModel->getCollection()
->addAttributeToFilter('sku', ['in' => ['999007102', '9247', '7549']])
->addWebsiteFilter([1])
->load();

echo $collection->count();

It returns me the 3 products without a problem.
However, if I run this other:
$searchCriteria = $this->searchCriteriaBuilder
->addFilter(\Magento\Catalog\Api\Data\ProductInterface::SKU, ['999007102', '9247', '7549'], 'in')
->addFilter('website_id', 1, 'in')
->create();
$items = $this->productRepository->getList($searchCriteria)->getItems();

echo count($items);

It returns me 0 products.
Why could it occur?
Thanks.


texts: Dialog.confirm popup animation bottom to top

texts:
i am using magento 1.9
i want to change the animation effect for the dialog popup
Please, how to change the FadeIn effect to "Bottom to up slide"

my code :

                var win =  Dialog.confirm(
            $('email').innerHTML, {
                className: "popup",
                id: "popupDialog",
                width: popupWidth,
                zIndex: 2001,
            }

            );


texts:
I want to add a "custom Price" which have been generated on the Product-Site to the product Price on the cart.

With the actual code it is only the value (price) of the hidden field which is delivered to the cart - without the product price.

Code with checkout_cart_product_add_after:

public function change_price(Varient_Event_Observer $observer) {

    $item = $observer->getQuoteItem();

    if ($item->getParentItem()) {
        $item = $item->getParentItem();
    }

    $newpricetest = Mage::app()->getRequest()->getPost('priceInput');

    $new_price = $item->getOriginalPrice() + $newpricetest;

    $item->setCustomPrice($new_price);
    $item->setOriginalCustomPrice($new_price);
    $item->getProduct()->setIsSuperMode(true);

}

What's wrong?


texts: Magento2 migration steps from 2.3.x Open Source to Commerce

texts:
I have been searching about this process (the technical part about a migration of Open Source 2.3 project to Commerce version), but there is not too much info out there. At same time, the official resource about this seems so basic https://devdocs.magento.com/guides/v2.3/comp-mgr/upgrader/ce-ee-upgrade-start.html (without having yet the Magento Commerce access)
I have read somewhere you cannot use some 3rd party modules in Commerce version... First question would be: is it correct? If so, then I have lot of doubts at this point
This is purely because of code differences (code which exists in Commerce core version, but it doesn't in Open Source version), or is it some kind of legal thing about modules licensing?
Is there any way or tool to test that upgrade process to have a preview about errors we'll face & be able to plan something to fix them?
Any way to know which modules (apart from the Marketplace ones) we'd need to remove / rewrite?
Apart from the code  differences, is there any other requirement about coding quality (such as including testing, etc...) to have a module working in Commerce version?


texts: set default router if method not specified

texts:
I have a custom module inside my local code pool and folder structure for the same is as below:

app
  code
     local
        namespace
           module
               controllers
               etc
etc
   modules
      namespace_module.xml

namespace_module.xml:

<config>
    <modules>
        <Namespace_Module>
            <active>true</active>
            <codePool>local</codePool>
            <version>0.0.1</version>
        </Namespace_Module>
    </modules>
</config>

namespace/module/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Module>
            <version>1.0.0</version>
        </Namespace_Module>
    </modules>
    <frontend>
        <routers>
            <module>
                <use>standard</use>
                <args>
                    <module>Namespace_Module</module>
                    <frontName>module</frontName>
                </args>
            </module>
        </routers>
    </frontend>
</config>

controllers/UploadController.php

<?php
class Namespace_Module_UploadController extends Mage_Core_Controller_Front_Action{
    public function indexAction(){
        echo "Hi Buddy.."; die();
    }

}

If I run the url as below,

http://myhost/project/module/upload

it access the indexAction()

But if I dont mention the controller name, it should access indexAction of the uploadCOntroller, How can I do this? I mean if I run below url

http://myhost/project/module/

it should access uploadcontroller/index action/


texts: How to get external Extension in static blocks

texts: I downloaded and using a Testimonial extension now I need to get content of that extension into a static block so that I display my testimonials in pages.I use magebuzz testimonial  extension and I contacted the developer support as it is a free extension they said they will not provide any code support.


texts: Show only free shipping if subtotal is greater than 100 and not to show if less than 100

texts:
I have two shipping method enabled Free Shipping and Flat Rate

I would like to show Free Shipping is the only option if total order amount is greater than 100

And show Flat Rate as only option if total order amount is less than 100.

I created Shopping cart price rule in such a way that

If ALL  of these conditions are TRUE :

Shipping Method  is  [freeshipping] Free
Subtotal  greater than  100
Shipping Method  is not  [flatrate] Fixed
Subtotal  greater than  100

This way it is working fine if order amount is less than 100. It is not showing Free Shipping option. But when order is greater than 100 it shows both the options.


texts: I made a custom admin page and i am saving some configuration fields there and then am getting a notification from magento that i need to flush the cache. Is there any way to do that from the module itself? maybe put a hook where i save the config?


texts: Creating a order from the backend, adding quantity calculates a incorrect price

texts:
Somehow Magento calculates an incorrect price when adding an order from the backend.

This problem only occurs on products with a custom option field and when the locale is set to a land that uses commas in prices, instead of dots.

In my case, that is Dutch.

To demonstrate the steps I take:

Adding a product, goto:

Sales -> Orders -> Create new order
Click 'add product'

Select a product with a custom option, so a popup appears.
Remember to set the locale first to another one (for instance: Netherlands) before you add the custom option product, else the miscalculation won't happen.

When you click 'ok' you will see that the quantity is multiplied by 100.

This a something strange, on a fresh installation of Magento it also occurs.

My best bet would be there is a problem with the javascript parsing the prices incorrectly, because of the format used (. instead of ,) .

I know that I can go a step further in the 'adding product' process, where you can edit the quantity. But, I still want to get this working normal for clients.

Can someone suggest the proper solution to resolve this issue?


texts: What are the definitions of the order statuses? OR: Where should I integrate my order state?

texts:
I want to define some order states like "credit card payment received", the question is to which statuses they belong. Is there a definition for each of the built-in statuses?

Edit: Seems like I mixed up "status" and "state", I hope it gets clear from the context anyways. I blame the German Magento translation (State => Status, Status => Zustand)


texts: How can I programmatically flush Magento's Cache?

texts:
I'm automating release configurations by bootstrapping Mage in several release scripts.  At the end of the scripts, I need to flush Magento's cache.

Is there a way to flush the cache using one of the Mage classes or methods?


texts: minify JS causes error related to braintree.min.js

texts:
As the subject says, Braintree payment method does not show up after minified JS. There is error

  NetworkError: 404 Not Found -
  https://js.braintreegateway.com/v2/braintree.min.js"

Braintree.min.js does not exist but braintree.js. Does anyone have the same issue and solution for it. Thanks in advance.


texts: How to display images in templates and where to place that image?

texts:
In my template I want to display an image.

How can I do it?
Where do I place my image?
How can the path of to image be specified in template file (pattern)?


texts: Magento 2 upgrade error - Upgrading from 2.3.2 to 2.3.5-p1 . Setup:upgrade Integrity Constraint Violation

texts:
I am trying to upgrade a magento store from magento 2.3.2 to Magento 2.3.2-p1
However I am stuck at the bin/magento setu:upgrade section with a SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails error.
So running bin/magento setup:db-schema:upgrade separately to verify also spits out the following
In Mysql.php line 110:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`DBNAME`.`#sql-7d3_8c0ef`, CONSTRAINT `SALES_ORDER_CUSTOM
  ER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE SET NULL), query was: ALTER TABLE `sales_order` MODIFY COLUMN `entity_
  id` int(10) UNSIGNED NOT NULL  AUTO_INCREMENT COMMENT "Entity ID", MODIFY COLUMN `store_id` smallint(5) UNSIGNED NULL   COMMENT "Store ID", MODIFY COLUMN `customer_id` int(10) UNSIGNED
   NULL   COMMENT "Customer ID", MODIFY COLUMN `billing_address_id` int(11)  NULL   COMMENT "Billing Address ID", MODIFY COLUMN `quote_address_id` int(11)  NULL   COMMENT "Quote Address
  ID", MODIFY COLUMN `quote_id` int(11)  NULL   COMMENT "Quote ID", MODIFY COLUMN `shipping_address_id` int(11)  NULL   COMMENT "Shipping Address ID", MODIFY COLUMN `increment_id` varcha
  r(32) NULL  COMMENT "Increment ID", MODIFY COLUMN `ext_customer_id` varchar(32) NULL  COMMENT "Ext Customer ID", MODIFY COLUMN `ext_order_id` varchar(32) NULL  COMMENT "Ext Order ID",
  MODIFY COLUMN `original_increment_id` varchar(32) NULL  COMMENT "Original Increment ID", MODIFY COLUMN `relation_child_id` varchar(32) NULL  COMMENT "Relation Child ID", MODIFY COLUMN
  `relation_child_real_id` varchar(32) NULL  COMMENT "Relation Child Real ID", MODIFY COLUMN `relation_parent_id` varchar(32) NULL  COMMENT "Relation Parent ID", MODIFY COLUMN `relation_
  parent_real_id` varchar(32) NULL  COMMENT "Relation Parent Real ID", MODIFY COLUMN `store_name` varchar(255) NULL  COMMENT "Store Name", MODIFY COLUMN `gift_message_id` int(11)  NULL
   COMMENT "Gift Message ID", ADD CONSTRAINT `SALES_ORDER_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`)  ON DELETE SET NUL
  L, ADD CONSTRAINT `SALES_ORDER_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`)  ON DELETE SET NULL

In Mysql.php line 91:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (DBANAME.#sql-7d3_8c0ef, CONSTRAINT SALES_ORDER_CUSTOM ER_ID_CUSTOMER_ENTITY_ENTITY_ID FOREIGN KEY (customer_id) REFERENCES customer_entity (entity_id) ON DELETE SET NULL)


texts:
Is there any way to count how many pages there is in pagination?
I'm not talking about Collection count, but something like pagination count maybe?


texts: Filter near by location product collection -magento2

texts:
I have thousands of property in my store. I'm trying to write automated related properties. Each property has latitude and longitude. When customer click anyone property, we need to suggest five top most near by properties as related properties we have.

I found a way to get nearest product by using below mysql query

    SELECT latitude, longitude, SQRT(POW(69.1 * (latitude - [startlat]), 2) +
POW(69.1 * ([startlng] - longitude) * COS(latitude / 57.3), 2)) AS distance
FROM TableName HAVING distance < 25 ORDER BY distance;

But it hard to convert as search criteria or apply filter to product collectionFactory

Testing controller

<?php

namespace Bilal\Test\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{

    protected $resultPageFactory;
    protected $jsonHelper;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        \Magento\Catalog\Model\ProductRepository $productRepository,
        \Magento\Framework\Api\SearchCriteriaInterface $criteria,
        \Magento\Framework\Api\Search\FilterGroup $filterGroup,
        \Magento\Framework\Api\FilterBuilder $filterBuilder,
        \Magento\Catalog\Model\Product\Attribute\Source\Status $productStatus,
        \Magento\Catalog\Model\Product\Visibility $productVisibility

    ) {
        $this->resultPageFactory = $resultPageFactory;
        $this->productRepository = $productRepository;
        $this->searchCriteria = $criteria;
        $this->filterGroup = $filterGroup;
        $this->filterBuilder = $filterBuilder;
        $this->productStatus = $productStatus;
        $this->productVisibility = $productVisibility;
        parent::__construct($context);
    }

    public function execute()
    {

        //Main Product Collection
        $target=$this->productRepository->getById(501);
        $lat =(float) $target->getCustomAttribute('c_lat')->getValue();
        $long =(float)$target->getCustomAttribute('c_long')->getValue();

        // Suggestde Near By Products Using Above Lat Long
        // Below one is return full product collection but I need to apply the above MYSQL query logic here
        $this->filterGroup->setFilters([
            $this->filterBuilder
                ->setField('status')
                ->setConditionType('in')
                ->setValue($this->productStatus->getVisibleStatusIds())
                ->create(),
            $this->filterBuilder
                ->setField('visibility')
                ->setConditionType('in')
                ->setValue($this->productVisibility->getVisibleInSiteIds())
                ->create(),
        ]);

        $this->searchCriteria->setFilterGroups([$this->filterGroup]);
        $products = $this->productRepository->getList($this->searchCriteria);
        $productItems = $products->getItems();

        Return $productItems;

    }

}


texts: I am trying to get current quote details in an phtml

texts:
class Productinfo extends \Magento\Framework\View\Element\Template
    {
       protected $checkoutSession;
       public function __construct(
          \Magento\Backend\Block\Template\Context $context,
          \Magento\Checkout\Model\SessionFactory $checkoutSession,
           array $data = []
       )
     {
          $this->checkoutSession = $checkoutSession;
          parent::__construct($context, $data);
      }

     /*
      * Checkout Session Data
     */
      public function getCheckoutSession()
      {
         return $this->checkoutSession->create();
      }
    }

This is block file function when I use the this function it gives data of last quoteId not current when cache is on.Please help me with this


texts: how to migrate custom code from magento 1.9.2 to magento 2.1

texts:
I have created custom modules in Magento 1.9.2,Now I am moving into Magento 2.1. So I need to transfer custom code from Magento 1.9.2 to Magento 2.1.
Please help me.


texts:
When I try to upload some images on cms->pages in wysiwyg redactor I get an error

The directory is not writable by server.

I have already explored this error caused because of media->wysiwyg folder is missing. If I create this folder all will be fine. But I wonder why this folder is missing after installation magento. Can someone explain?


texts: In my site, paypal is missing from the admin side.It is working perfectly on fronted. But not showing in payment methods.Now I want to change paypal account credentials. Any suggestions?


texts: Magento update: An error occurred while saving the URL rewrite

texts:
After updating Magento 1.9.2.1 >> 1.9.2.2 I get stuck with the following error:

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'product/2/8-1-2' for key 'UNQ_MAG_CORE_URL_REWRITE_ID_PATH_IS_SYSTEM_STORE_ID', query was: INSERT INTO `mag_core_url_rewrite` (`store_id`,`category_id`,`product_id`,`id_path`,`request_path`,`target_path`,`is_system`) VALUES (?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `store_id` = VALUES(`store_id`), `category_id` = VALUES(`category_id`), `product_id` = VALUES(`product_id`), `id_path` = VALUES(`id_path`), `request_path` = VALUES(`request_path`), `target_path` = VALUES(`target_path`), `is_system` = VALUES(`is_system`)' in /home/sntruck/domains/sn-truckstyling.com/public_html/webshop/lib/Zend/Db/Statement/Pdo.php:235

How can I fix this (I don't have SSH access)


texts:
Im trying to get a series of attributes to show if an attribute value is set to yes.

Here is my code but it is not working:

 <?php if($_product->getAttributeText("vm_activate")== 1) ?>

<?php echo $this->__('VMware SKU: ') ?><?php echo $_product->getVmwareSku() ?>

<?php echo $this->__('VMware Type: ') ?><?php echo $_product->getVmware() ?>

<?php echo $this->__('VMware Price: ') ?><?php echo $_product->getVmwarePrice() ?>

    <?php endif; ?>


texts: Export CSV in Shipping Rates doesn't work

texts:
I have Magento 2.1.1 in production mode. I go to:

Stores -> Configuration -> Sales -> Shipping Methods.

When I try to export the CSV example to upload the rathes, the system after 10 seconds redirect me to the home.

I tried to debug the problem but it's not any error apparently.

Thanks for help


texts: IP whitelisting according to new Magento best practices

texts:
Recently Magento updated the post: "Protect your Magento Installation from Password Guessing", see: https://magento.com/security/best-practices/protect-your-magento-installation-password-guessing-new-update

While in the original post they advised to put the following in the root .htaccess file:

RewriteCond %{REQUEST_URI} ^.*/ADMIN_PANEL_LOCATION [OR,NC]

RewriteCond %{REQUEST_URI} ^.*/DOWNLOADER [OR,NC]

RewriteCond %{REQUEST_URI} ^.*/RSS/CATALOG [OR,NC]

RewriteCond %{REQUEST_URI} ^.*/RSS/ORDER [NC]

RewriteCond %{REMOTE_ADDR} !^1.2.3.4

RewriteCond %{REMOTE_ADDR} !^5.6.7.8

RewriteRule ^(.*)$ http://%{HTTP_HOST}/ [R=302,L]

Now they seem to recommend the following approach:

# Whitelist an IP address for the admin panel
RewriteCond %{REMOTE_ADDR} !^xx.xx.xx.xx
RewriteRule ^(index.php/)?admin/ - [L,R=403]

# Whitelist an IP address for the RSS feed
RewriteCond %{REMOTE_ADDR} !^xx.xx.xx.xx
RewriteRule ^(index.php/?)?rss/ - [L,R=403]

and put this in the ./downloader/.htaccess file:

order deny,allow
deny from all
allow from xx.xx.xx.xx

I am not much expert on this subject, so I was wondering:

if both the first and second method are good for Magento 1
what the difference really is between one approach over the other
and if there's one which is better


texts: Convert third party extension shipping delivery date transactional variable format from YYYY/MM/DD to DD/MM/YYYY in Magento 2

texts:
This question isn't about how to change the Magento data/time format.

I use a third-party shipping platform that stores delivery date as part of the order and the delivery date is order specific. It is held in the DB against the order.

Their extension exposes that data as a variable - {{var deliveryDate}} for inclusion in transactional emails and that bit works ok.

The problem I'm having is they store the date as UTC YYYY/MM/DD in the database and it's confusing for UK customers to read dates in that order.

My question is does anyone know if there is there a way in PHTML that enables me to change the display of that variable into something more UK friendly?

I'm not trying to change the display date in the frontend, I know how to do that, this is changing the format of a specific variable from a 3rd party extension.
Would appreciate that help everyone.


texts: Unable to export product CSV "No valid data sent"

texts:
I am trying to export products using System -> Import/Export -> Export After selecting Export Settings and click on Continue, I am getting No valid data sent.

Looking in the system.log It is showing:

  2016-12-21T12:28:50+00:00 EMERG (0): Redis configuration does not exist, falling back to MySQL handler.

  2016-12-21T12:28:50+00:00 ERR (3): Notice: Undefined offset: 4271  in /var/www/clients/client5618/web7022/web/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php on line 875

There are 7000+ products. Please let me know what is wrong with this and how do I fix it?

Thank You :)


texts:
I have integrated Solr with Magento EE. Solr logs whatever I search in Magento fronted search box.

I'd like to know if Magento will also use Solr engine if the search REST API is called?

Endpoints-

Product Details - GET- http://<magento_host>/rest/V1/products/:sku

Get Category - GET - http://<magento_host>//V1/categories/:categoryId

General Search API - GET

http://<magento_host>/rest/V1/products/?
searchCriteria[filter_groups][0][filters][0][field]=category_gear&
searchCriteria[filter_groups][0][filters][0][value]=86&
searchCriteria[filter_groups][0][filters][0][condition_type]=finset

and the API's mentioned here
http://devdocs.magento.com/guides/v2.0/howdoi/webapi/search-criteria.html


texts:
A developer modified some of our core magento files... not sure I trust the code... Our profiler is saying "mage::dispatch::routers_match" and "mage::dispatch::controller::action::predispatch" are taking 10 and 6 seconds respectively. The code was modified as below:

public function dispatch()
{
    $request = $this->getRequest();

    // If pre-configured, check equality of base URL and requested URL
    $this->_checkBaseUrl($request);

    $request->setPathInfo()->setDispatched(false);

    $this->_getRequestRewriteController()->rewrite();

    Varien_Profiler::start('mage::dispatch::routers_match');
    $i = 0;
    while (!$request->isDispatched() && $i++ < 100) {
        foreach ($this->_routers as $router) {
            /** @var $router Mage_Core_Controller_Varien_Router_Abstract */
            if ($router->match($request)) {
                break;
            }
        }
    }
    Varien_Profiler::stop('mage::dispatch::routers_match');
    if ($i>100) {
        Mage::throwException('Front controller reached 100 router match iterations');
    }
    // This event gives possibility to launch something before sending output (allow cookie setting)
    Mage::dispatchEvent('controller_front_send_response_before', array('front'=>$this));
    Varien_Profiler::start('mage::app::dispatch::send_response');
    $this->getResponse()->sendResponse();
    Varien_Profiler::stop('mage::app::dispatch::send_response');
    Mage::dispatchEvent('controller_front_send_response_after', array('front'=>$this));
    return $this;
}

Does this look ok or can the time needed for the 2 about items be explained by this code? I am sure I would need to provide more information to answer my question, let me know what else I need to send!

Thanks


texts: Product grid - sorting by custom field - not treating as integer

texts:
I have a Magento 2.4.1 site where I've added a custom attribute to store a discount percentage. I want to sort a category by this value.
However, in the grid list view (based off the Luma theme), it treats the percentage saving as a string. For example, it orders them as follows:

2
23
5
57
6
60

...instead of:

2
5
6
23
57
60

The attribute is configured as:

Catalog Input Type for Store Owner: Text field
Input Validation for Store Owner: Integer number

Is there a way to force it to be treated as an integer so it orders properly?


texts: display all and only direct children of a category

texts:
Say I have the following category and product structure:

    1. Category
        a. Subcategory
           i. Product
           ii. Product
        b. Subcategory
           i. Product
        c. Product
        d. Product

When viewing the category page, I want to show all and only its direct children. So, for this example, I would want to list a, b, c & d (but not a i., a ii., etc.).

I'm pretty new at Magento, so I'm having trouble stitching together a view that does what I want it to. So far, I have this:

<?php
$category = Mage::getSingleton('catalog/layer')->getCurrentCategory();
$categories = $category->getCollection()
        ->addAttributeToSelect(array('name', 'thumbnail'))
        ->addAttributeToFilter('is_active', 1)
        ->addIdFilter($category->getChildren())
?>

    <?php foreach ($categories as $category): ?>

            <a href="<?php echo $category->getUrl() ?>">

                <img src="<?php echo Mage::getBaseUrl('media') . 'catalog' . DS . 'category' . DS . $category->getThumbnail() ?>" alt="<?php echo $this->htmlEscape($category->getName()) ?>" />

<?php echo $category->getName() ?>

    <?php endforeach; ?>

This will display the subcategories, but it won't display the products, if they are direct children. I don't really understand Magento's syntax yet, so I don't quite know what I'm doing here (I copied, adopted, and pasted this from elsewhere on the web).

Is there a way to generalize this list item to display the product thumbnail and url, if it's a direct child? Or, perhaps to create another list item that displays the product, on the condition that the direct child is a product, and not a subcategory?


texts: Visa, Mastercard and Boleto with Magento (Brazil Payments)

texts: Is there a secure and open source (or free) Magento module to take payments via Visa, Mastercard cards and Boleto, for Brazil?


texts:
I have placed in my env file:

 'session' =>
  array (
    'save' => 'files',
  ),

I have not mentioned the save path here. So where it will be saved as I could not find it in the var/session directory. I also want to know is it safe to use for a large scale website or I should use Redis instead.

PS: I have two questions for this-

  Is it safe to use savepath as 'save_path' => 'var/session', because
  var folder has permission to read/write and common folder for saving.
  Also I want to know why people use redis instead of files. Is there
  any Cons for storing in var/session

Thanks


texts: How to move related products at very bottom of product page?

texts:
I want to display the related products at very bottom of the product page. How can I move it?

Can anyone please explain me?


texts: Force magento compiler to only compile the 4 basic scopes (default.php/catalog.php/checkout.php/cms.php)

texts:
Magento 1.9.0.1
SUPEE-6788
SUPEE-7405

Hi

Since i've installed the latest patches of magento, instead of the 4 basic scopes default.php/catalog.php/checkout.php/cms.php, i've got 13 default/cms/catalog/checkout/adminhtml/contacts/sales/configurator/customer/reviewemail/authorizenet/firewall/api. And if i enable it, i get a blank page when i try to click on the system/configuration tab in admin.

I've tried everything : Flush, recompile, disable local module..etc. Nothing works and it doesn't give me anything in log/debugging/display errors.

So i was thinking, what if i change the compiler core file to only compile the 4 basic scopes default.php/catalog.php/checkout.php/cms.php, it could at least work for the base and stop showing that error ?

I've read this article Correct Method of Flushing Caches & Managing the Compiler which explains in detail the working of compiler.

Hope somenone can help me, i've searched and tried everything.

Kind regards,
Marc


texts: Order confirmation email sent before redirecting to third party payment gateway in Magento 2

texts:
I have created one third party Payment gateway.

It is working fine except, It is sending two order confirmation email. One email I have added in my custom module success controller to send email after validate Transaction Id. But one default email is also triggered by magento after place order.

Below is My Payment module payment.js file:

define(
    [
        'jquery',
        'ko',
        'mage/url',
        'Magento_Checkout/js/view/payment/default',
        'Magento_Checkout/js/model/quote',
        'Magento_Customer/js/model/customer'
    ],
    function ($, ko, url, Component, quote, customer) {
        'use strict';
        return Component.extend({
            defaults: {
                template: 'Stack_Custompay/payment/custompay-form'
            },
            redirectAfterPlaceOrder: false,
            /** Returns payment method instructions */
            getInstructions: function() {
                return window.checkoutConfig.payment.instructions[this.item.method];
            },
            afterPlaceOrder: function () {
                $.ajax({
                    type: 'POST',
                    url: url.build('custompay/payment/order'),
                    success: function (response) {
                        if (response.success) {
                            var order_id = response.order_id;
                            var amount = response.amount;
                            var billing_address = quote.billingAddress();
                            var name =  billing_address.firstname;
                            var contact = billing_address.telephone;
                            var email = customer.customerData.email;
                            var data = {
                              amount: amount,
                              email: email,
                              contact: contact,
                              order_id:order_id
                            };
                            custompay.createPayment(data);
                        }
                    },
                });
            }
        });
    }
);

I have checked many posts and found there is some option to disable default order email by plugin. but I think it is not the standard approach. I read, there are some changes we need to perform in payment.js file to stop these confirmation email as implemeneted in braintree payment gateway.

how I could achieve this in the right way? Any help would be appreciated. Thanks.


texts: How to configure magento 2 billing address different from shipping address with paypal

texts:
I'm trying to enable the customer to assign a different billing address from shipping address in the checkout process using Paypal payment and I can't find a way to do it.

Thanks


texts: Do not send shipment mail when shipment is submitted?

texts:
Magento 2.3.3
When the shipment is created from the admin (see https://i.imgur.com/ZhtZNio.png), a shipment mail is sent out to the customer. I tried searching for that mail sending part in the code in Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save.php but wasnt able to find it.
Any idea where the mail is being sent to the customer when the "submit shipment" button is clicked?
Thanks!


texts: magento 2: How to edit a cronjob/crontab schedule in the admin backend

texts:
I have been searching almost all day and i can't seem to find how i can change a cronjob/crontab its settings/schedule without using cache:reflush after changing the crontab.xml file.

This is so I can change a cronjob his schedule while the shop is running and i don't need to reflush the cache.

I think the cronjob's schedule get's saved in the cache but can't seem to find how not to do this...

so how can i do this?

EDIT: i can probably do this like this: How to set cronjob dynamic schedule from database in Magento 2


texts:
I'm having problems uploading a new module that i have created. I upload all the files to the right place then I get a message asking me to setup:upgrade because of the new module and the re compile.

After doing this I can't access the site. When I run grunt clean etc... It starts coming up with loads of errors. So what I would like to know is what order and what commands do I need to run to install the new module correctly?

Am I also right in calling them modules? The module I created was called Magento_SearchSlide.

Version Magento 2


texts: How to change "Default Value Store View in 1.9.2?

texts:
I´m getting crazy, I´m trying to install a new language to my shop. I´m working with Magento 1.9.2, them, I select germain.

After get the URL to install in Magento Connect, I install my new extension, everything looks like good.

After that, I get a Succesfully Clean Cache, etc... good.

But, now I want my shop in this language, I go to Manage Storage > Main Website Store:

I want to change the 4th option and set "Germain" or something, but I can´t change.

I am forgetting something?


texts: How to show error message for checkbox on checkout page in Magento 2?

texts:
I have created some steps in Magento 2 and added a checkbox on one step and added required validation for the same.
Validation works perfectly if it is not checked it will not go further but if it is not checked it will not show any error.

my checkbox code in template is
<div class="checkout_usercheckbox">
<input class="required-entry input-checkbox" data-validate="{required:true}" type="checkbox" name="summery_usercheckbox">Accept Terms and Condition
</div>

Why it doesn't show error message like to accept term and condition of required.
Any help is appriciated.


texts: Magento 2 : on tab click ko js and template render

texts:
In my module, there are tab structure same like mentioned in this below image tab structure. I want to do like that, when on tab click at that time, ko template and ko js should be render.

How to do that ?

Any help would be appreciated.

Thanks.


texts: Get cached thumbnail image url in Magento 2.2

texts:
I need to get the url of a product cached thumbnail image.
This is my code:

$appEmulation->startEnvironmentEmulation($_POST['store_id'], \Magento\Framework\App\Area::AREA_FRONTEND, true);

$image = $helperImage->create()->init($product, 'product_thumbnail_image')
                    ->constrainOnly(TRUE)
                    ->keepAspectRatio(TRUE)
                    ->keepTransparency(TRUE)
                    ->keepFrame(FALSE)
                    ->resize(245,300);

$temp[] = $image->getUrl();

$appEmulation->stopEnvironmentEmulation();

The path I get is http://domain.com/pub/static/version1522319407/frontend/Vendor/theme_child/it_IT/Magento_Catalog/images/product/placeholder/thumbnail.jpg

How can I get the cached thumbnail image url?
Thanks in advance.


texts: Magento 2 checkout shipping address not showing country

texts:
I've made it so it programmatically creates a user's mail and shipping address whenever they sign in via an external SSO. e.g. google sso.

The shipping address appears fine in the user's address book which includes the country.

but not in the checkout page, nor in the admin area:

The country comes back as a country code for example: GB or AU but in lower case.

Code for the address creation:

$_customer = array (
            'given_name' => $given_name,
            'family_name' => $family_name,
            'email' => $email,
            'birthdate' => $birthdate,
            'gender' => $gender,
            'street_address' => $decodedAddress->street_address,
            'locality' => $decodedAddress->locality,
            'postal_code' => $decodedAddress->postal_code,
            'country' => $decodedAddress->country,
            'region' => $decodedAddress->region,
            'phone_number' => $phone_number,
        );

        $customer = $this->customerCustomerFactory->create();

        $customer->setEmail($_customer['email'])
                ->setFirstname($_customer['given_name'])
                ->setLastname($_customer['family_name'])
                ->setInchooSocialconnectPPid($pixelpinId)
                ->setInchooSocialconnectPPtoken($token)
                ->save();

        $customer->setConfirmation(null);
        $customer->save();

        if(empty($decodedAddress->street_address)) {

        }
        else
        {
            $customAddress = $this->addresss->create();

            $customAddress->setCustomerId($customer->getId())
                    ->setFirstname($_customer['given_name'])
                    ->setLastname($_customer['family_name'])
                    ->setCountryId($_customer['country'])
                    ->setPostcode($_customer['postal_code'])
                    ->setCity($_customer['locality'])
                    ->setTelephone($_customer['phone_number'])
                    ->setStreet($_customer['street_address'])
                    ->setIsDefaultBilling('1')
                    ->setIsDefaultShipping('1')
                    ->setSaveInAddressBook('1');
                $customAddress->save();
        }

        $this->customerSession->setCustomerAsLoggedIn($customer);


texts:
I try to make a payment with using PayPal (payflow, payflow pro, etc.) but in result I get error:

  Your payment has been declined. Please try again

or

  The PayPal gateway rejected the request. User authentication failed

I have a configuration for PayPal in admin panel. What is the problem?

Magento 2 (2.1.3, 2.1.4).


texts: Grid not receiving array data from DataProvider

texts:
In my module, I use the Listing (grid) UI component to render data from an array. The data for the grid is provided by a DataProvider.php class getData() method.
For some reason, when I use a simple testing array, the data is properly rendered. When I use the actual array that I want to use, the grid displays the message:
We couldn't find any records.
I am very sure that both arrays have the same format, so both should work. Using print_r() to print the arrays, they look identical in format. gettype() returns array for both arrays.
My DataProvider.php:
public function getData()
    {
        $orderIds = $this->_registry->registry("orderids");

        foreach ((array)$orderIds as $orderId) {

            $order = $this->_order->load($orderId);

            $orderInfo[] = [ // This array doesn't work
                "entity_id" => $order->getId(),
                "customer_firstname" => $order->getCustomerFirstname(),
                "customer_lastname" => $order->getCustomerLastname(),
                "customer_email" => $order->getCustomerEmail(),
            ];
        }

        $test[] = [ // This test array works
            "entity_id" => 1,
            "customer_firstname" => "Foo",
            "customer_lastname" => "Bar",
            "customer_email" => "foo@bar.com",
        ];

        $data = [
            'totalRecords' => count($orderInfo), // $test works, $orderInfo doesn't
            'items' => array_values($orderInfo), // $test works, $orderInfo doesn't
        ];

        /** @var ModifierInterface $modifier */
        foreach ($this->modifiersPool->getModifiersInstances() as $modifier) {
            $data = $modifier->modifyData($data);
        }
        return $data;
    }

Short description of the code: Order IDs are stored in the registry, a foreach() loop loops over every order ID and loads the order objects for those IDs, order data is stored in the $orderInfo array, which should be used to provide data to the grid.


texts:
I am new to magento. I have installed magento in localhost and login admin panel.

Now i run 127.0.0.1/magento/admin in localhost, after logged in it displayed one page it contains number of fileds such as cmc,catalog,...

May i know how to create and design home page in magento.

I refered in google, little i confused.

Can anyone help me?

Thanks in advance.


texts: Magento 2 - Alternative use for getOrderPlaceRedirectUrl function

texts:
I am a newbie for Magento 2 module development. Have been working on Magento 1.9.x for quite a time and also used to work with getOrderPlaceRedirectUrl function for sending request to a payment service provider.

The query is I don't find the function is still the right one / in use for Magento 2 module. Curious to know is there any alternative without using payment actions ( capture and authorize ) to send the request.

I would be so grateful if someone helps me out of this.


texts: Why has "Shop by ..." disappeared when using ElasticSearch?

texts:
I just finished setting up ElasticSearch with my Magento store. I've used magento-elasticsearch for this.

The search is much better compared to the default search engine.

But for some reason the "Shop by ..." on the left side has disappeared.

This is what it looked like with the default search:

This is what it looks like with ElasticSearch:

How can I get it back?

(Magento 1.9.0.1 with ElasticSearch 1.3.2)


texts: Get attributes value from items in order

texts:
I'm actually working on a website in Magento 2.
I have to print entire order in PDF.
But I don't know how can I get the products attribute value.
There is my code :
 foreach ($order->getAllItems() as $item) {

                $product = $item->getProduct();
                $itemName = $item->getName();
                $itemAdr = $product->getAdressage();
                $itemQty = (int)($item->getData('qty_ordered'));
                $itemEan = $item->getProduct()->getData('ean_code');
                $sku = $item->getProductId();

                $page->drawText($itemQty,20,$y, 'UTF-8');
                $page->drawText($itemAdr,45, $y, 'UTF-8');
                $page->drawText($itemName, 100, $y, 'UTF-8');
                $page->drawText($itemEan, 500,$y, 'UTF-8');
                $page->drawText($sku, 550,$y,'UTF-8');
                $y = $y - 20;
            }

I can only get itemName and Quantity Ordered...
Can you help me on this feature ?
Thanks in advance


texts:
How to  show a advance inventory custom field  value in  checkout order summary  in magento  2

Product edit page in admin

checkout page

code:

 <?php
namespace Cm\Preorder\Plugin\Checkout\Model;

use Magento\Checkout\Model\Session as CheckoutSession;
use Magento\Catalog\Model\ProductRepository as ProductRepository;
use Magento\CatalogInventory\Model\Stock\StockItemRepository;

class DefaultConfigProvider extends \Magento\Framework\Model\AbstractModel
{
    protected $checkoutSession;

    protected $stockItem;

    protected $_productRepository;

    private $_objectManager;

    public function __construct(
        CheckoutSession $checkoutSession,
        ProductRepository $productRepository,
        \Magento\CatalogInventory\Model\Stock\StockItemRepository $stockItem,
          \Magento\Framework\ObjectManagerInterface $objectmanager
    ) {
        $this->checkoutSession = $checkoutSession;
        $this->_productRepository = $productRepository;
        $this->stockItem = $stockItem;
        $this->_objectManager = $objectmanager;

    }

    public function afterGetConfig(
        \Magento\Checkout\Model\DefaultConfigProvider $subject,
        array $result
    ) {
        $items = $result['totalsData']['items'];
        foreach ($items as $index => $item) {
            $quoteItem = $this->checkoutSession->getQuote()->getItemById($item['item_id']);
            $product = $this->_productRepository->getById($quoteItem->getProduct()->getId());

            $productId = $product->getId();
            $stock = $this->stockItem->get($productId);
        /*    $preorder_note = $stock->getData('preorder_note'); */
            $result['quoteItemData'][$index]['preorder_note'] =$productId;
        }
        return $result;
    }

}


texts: How can I improve my Product Export time duration for Bulk export

texts:
In my store approximately 16,000 products are there. When I try to export both ways import/export or dataflow, both show error. But when I export less amount of data (say 200-300 products at a time), I am able to export my products. Which means I can't able to export all my products at a single file.

System > Import/Export > Export error:

System > Import/Export > Dataflow profiles > Export all products error:


texts: Magento Blocks HTML Output cache problem

texts:
I have a problem with my Magento website.

Because my website was extensively redesigned, notably the home page - I have had the cache disabled on the page for about a month or two.

Now I was able to enable all cache modules except Blocks HTML Output module. When I switch it on, my Magento is displaying the old home page. Sometimes it also says that cache is Invalidated.

Refreshing and flushing cache does nothing. So does the manual deletion of files from var/cache folder.

I am clueless. I've heard that usually, people have a problem with products not showing due to blocks html but this is really confusing. How can I rectify this problem?


texts: How to remove trailing slash from all website pages in Magento ver. 1.14.2.2

texts:
Any solution for resolving the trailing slash issue from all the website pages. The Home page is running with a trailing slash. Example -

http://www.example.com/

Apart from the Home page, the rest of the website pages are running with and without trailing slash by default.

http://www.example.com/category/sub-category.html/

How to resolve the trailing slash issue from all website pages except Home page and also if trailing slash would be resolved at once, then how would it impact the Home page.

Do we need to set a redirect rule to the new Home page without trailing slash?

Moreover, the website is currently accessible with HTTP and HTTPS versions, but by default, it is running with HTTP.


texts: Magento 2: What is the `module` Attribute in `menu.xml` Files Used For?

texts:
In Magento 2, when you add a menu item, you need to specify a module attribute (module="Magento_Backend" below)

<add id="Magento_Backend::system_currency"
     title="Currency"
     module="Magento_Backend"
     sortOrder="30"
     parent="Magento_Backend::stores"
     action="adminhtml/system_currency"
     resource="Magento_CurrencySymbol::system_currency"
/>

What does the Magento system use this attribute for? i.e., why does the menu rendering need to know which module a Menu Item comes from?


texts:
I want to add an email row to reviews_details.

In my Setup-folder is install-1.0.0.php:

<?php

namespace MS\RealReviews\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

class InstallData implements InstallDataInterface
{

    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
      {
        $installer = $setup;

        $installer->startSetup();

        $eavTable = $installer->getTable('review_detail');

        $columns = [
            'email' => [
                'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                128,
                'nullable' => true,
                'comment' => 'User E-Mail Address',
            ],

        ];

        $connection = $installer->getConnection();
        foreach ($columns as $name => $definition) {
            $connection->addColumn($eavTable, $name, $definition);
        }

        $installer->endSetup();
    }

}

My module.xml:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="MS_RealReviews" setup_version="1.0.0"/>
</config>

Overview of table after php bin/magento setup:upgrade:


texts: Magento 2.1 CE Installed but front/backend not loading/working

texts:
I am new to Magento and trying to install it myself but can't see it working after installing it successfully.

I followed Amazon instructions and installed PHP56, MySQL 5.7 & phpMyAdmin and then followed the following steps to install Magento 2.1 CE:

sudo su

vi /etc/php.ini
?always_populate_raw_post_data
I
always_populate_raw_post_data = -1
:wq
service httpd restart
sudo yum install php56-intl –y
service httpd restart
mkdir /var/www/html/magento2ce
upload magento tar file to /var/www/html/magento2ce and unzip using tar command
cd /var/www/html/magento2ce
tar zxf Magento-CE-2.1.1-2016-08-29-06-31-39.tar.gz
And before installation I used following command to assign permissions to magento folders: cd /var/www/html/magento2ce && find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \; && find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \; && chown -R :apache . && chmod u+x bin/magento

And after all that I stared Setup Wizard which ran successfully.

But nothing works when I try to access front/backend.

Can any one please let me what I am missing here?


texts: Show static banner or category banner on product page

texts:
I have the following code in product/view.phtml:

<?php
    if(Mage::registry('current_category')):
    $_category=Mage::registry('current_category');
    $_helper    = Mage::helper('catalog/output');
        $_imgHtml   = '';
        if ($_imgUrl = $_category->getImageUrl()) {
            $_imgHtml = '
escapeHtml($_category->getName()).'" title="'.$this->escapeHtml($_category->getName()).'" />
';
            $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
        }?>

    <?php if($_imgUrl) { ?>

    <?php echo $_imgHtml ?>
    <?php }else{ ?>

    <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('cms_top_banner')->toHtml(); ?>
<?php }?>
<?php endif;?>

This currently shows either the category banner or a static banner if the category does not currently have a banner. However, if I visit the product page directly then no banner is displayed.

Can anyone please suggest an edit to the code so that if a user visits a product directly (i.e. not by visiting a category) then the static banner ('cms_top_banner') will be displayed.


texts: Display Subcategories images on home page

texts:
I am trying to display my subcategories images on my home page with the following code:

<?php
/**
* http://fishpig.co.uk - Magento Tutorials
* Display top level categories and subcategories
**/
$_helper    = $this->helper('catalog/output');
$_category  = $this->getCurrentCategory();
?>
<?php $_helper = Mage::helper('catalog/category') ?>
<?php $_categories = $_helper->getStoreCategories() ?>
<?php $currentCategory = Mage::registry('current_category') ?>

<?php if (count($_categories) > 0): ?>

    <?php foreach($_categories as $_category): ?>

            <?php $_category = Mage::getModel('catalog/category')->load($_category->getId()) ?>
            <?php $_subcategories = $_category->getChildrenCategories() ?>
            <?php if (count($_subcategories) > 0): ?>

                    <?php foreach($_subcategories as $_subcategory): ?>

                            <a href="<?php echo $_helper->getCategoryUrl($_subcategory) ?>">
                            <img src="<?php echo $_category->getImageUrl() ?>" width="200" height="200" />

                    <?php endforeach; ?>

            <?php endif; ?>

    <?php endforeach; ?>

But the image shows the parent category instead, can be seen in www.colagenosnella.com.br. Any Thoughts?
Thanks in advance.


texts: USPS Maximum Package Weight Not Restricting Weight

texts: I have a Magento CE 1.9 site. I am using USPS to ship all items under 1 lb and FedEx for all items over 1 lb. However, When I set the USPS Maximum Package Weight to 1 lb it still shows on items over 1 lb. Must I do something additional? Has anyone run in to this and have a solution?


texts: Magento 1.9.2.4 download file size is very large 424MB? where is Magento 1.9.2.1?

texts:
I am trying to download Magento 1.9.2.4 but it's file size is very huge approx 424MB. I have previously worked on Magento 1.9.2.1. It was only less than 100MB in file size, Now i am unable to find this version on Magento website and Magento 1.9.2.1 version was not big as the new version. So, my question is,  am i downloading correct file which is (Magento 1.9.2.4)?

Why there is huge difference of size between Magento 1.9.2.4(424MB) and Magento 1.9.2.1(Less than 100 MB)

Where should i download Magento 1.9.2.1?


texts: change order of attributes on product page (per product)

texts:
I would like to change the order of attributes on our product page. I know I can change this order that will apply to all product pages that these attributes exist, but I was wondering if I can change that order on a per product level.

EG. https://www.herbcottage.com.au/dried-burdock-root.html
Actions: I want these to appear in order of their importance to each herb.


texts:
I am having an issue with the wishlist. My store sells downloadable PDF knitting patterns. When a customer adds an item to their wishlist the price of the item is shown as 0.00 even though the item added has a price. When the item is then added to the cart the price is then correct in the cart.

Is there somewhere i can look to change a setting that allows the price to be shown correctly in the wishlist or alternatively take out the price all together on the wishlist. I am not very experienced with Magento so any assistance will be greatly appreciated.

I have attached 2 images. The first one shows the wishlist showing the wrong price of R0.00 while the second shows the cart after clicking the add to cart button showing the correct price of R20.00.


texts: how can i Get rating Factory in magento 2 ?

texts:
I need to get rating factory i try following both way but i show white page any one know what i doing wrong.
First Using Objectmanager

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$ratingObj = $objectManager->create('Magento\Review\Model\Rating');
print_r($ratingObj);
exit;

Second way using construct in my block for example

namespace Companyname\Modulename\Block;

class Customreview extends \Magento\Framework\View\Element\Template
{
  protected $_ratingFactory;

public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Review\Model\RatingFactory $ratingFactory,
        array $data = []
    ){
       $this->_ratingFactory = $ratingFactory;
       parent::__construct($context, $data);
    }

    public function getRatings()
    {
       return $this->_ratingFactory->create()->getResourceCollection()->addEntityFilter(
            'product'
        )->setPositionOrder()->addRatingPerStoreName(
            $this->_storeManager->getStore()->getId()
        )->setStoreFilter(
            $this->_storeManager->getStore()->getId()
        )->setActiveFilter(
            true
        )->load()->addOptionToItems();
    }
}


texts: Bulk product attribute update fails in the magento 2 back end

texts: When uploading the attributes for multiple products it fails each time. Kindly help me to solve this problem. My Magento version is 2.3.2


texts: Magento2 - Sometimes no products showing in categories

texts:
We have an odd problem where sometimes NO products will show on a category page. This appears to happen randomly across categories.

At other times...all products will be showing just fine.

When none are showing, I can click the Price Filter and then it will show all of the products.

I have cleared/flushed the cache, ran the indexer from the CLI.

We are running V2.1.2


texts: Magento 2 - Module Block Causes 404 Error

texts:
I have cobbled together a module for Magento 2 that is eventually going to insert a block in to the product page that pulls in other products with a similar attribute (in this case, "range").

When the module is enabled, I see it in the setup_modules table in the database, and see the CSS I've inserted in to the page from the module, however product pages return a 404 error.

If I remove the block call from the catalog_product_view.xml file that references the template, the page loads.

app/code/Company/RangeCollection/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Company_RangeCollection" setup_version="2.0.1" schema_version="0.0.1" active="true" />
</config>

app/code/Company/RangeCollection/Block/RangeCollection.php

<?php
namespace Company\RangeCollection\Block;

class RangeCollection extends \Magento\Catalog\Block\Product\AbstractProduct {

    protected $_collection;
    protected $_config;

    public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        \Magento\Catalog\Model\Resource\Product\Collection $collection,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        array $data = []
    ) {
        $this->_collection = $collection;
        $this->_config = $scopeConfig->getValue('range_collection/settings');
        parent::__construct($context, $data);
    }

    public function getProducts($currentRegion) {
        $limit = $this->getProductLimit();
        $collection = $this->_collection;
            //->addAttributeToFilter('region', 1);
        $collection->getSelect()
            ->order('rand()')
            ->limit($limit);
        return $collection;
    }

    public function getConfig() {
        return $this->_config;
    }

    public function getProductLimit() {
        return $this->_config["limit"];
    }

}

app/code/Company/RangeCollection/view/frontend/layout/catalog_product_view.xml

<?xml version="1.0"?>

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="content">
            <block class="Company\RangeCollection\Block\RangeCollection" name="range.collection" as="range" after="-" template="Company_RangeCollection::list.phtml"/>
        </referenceContainer>

</page>

app/code/Company/RangeCollection/etc/config.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Magento/Core/etc/config.xsd">
    <default>
        <range_collection>
            <settings>
                <limit>4</limit>
            </settings>
        </range_collection>
    </default>
</config>

app/code/Company/RangeCollection/view/frontend/templates/list.phtml

<?php
$_products = $this->getProducts();
$_config = $this->getConfig();
$_columnWidth = 100 / $this->getProductLimit();
?>

<?php echo __('Other products in this range') ?>

    <?php foreach ($_products as $_product): ?>
        <li class="item" style="width: <?php echo $_columnWidth; ?>%">

                <a href="<?php echo $_product->getProductUrl() ?>" class="product">
                    <?php echo $this->escapeHtml($_product->getName()) ?>

                <?php echo $this->getProductPrice($_product) ?>

    <?php endforeach; ?>


texts:
I need to get the users from my site in a specific format for a presentation.
Something like this:

fullname email phone

I dont know how to do this via MySQL because all the data is in different tables etc and its really confusing.

Any way to do this?


texts: Create product with json request using SOAP API in magento

texts: How to create simple product with json request using SOAP API in magento?