texts: Remove products from all categories when price is zero

texts:
For SEO reasons I want to keep products which are not being produced anymore on my website, so I edited some stuff so when I change the price of the products to 0,-. It displays a text that the product is unavailable, and it removes the 'add to cart' button.

Now I would like to remove them from all the categories they're in, and preferably also put them in a new category called 'Old models' (ID=863).

I don't really code myself but I found some parts and put them together.

What I have now:

// get products price 0
require_once('app/Mage.php'); //Path to Magento
    umask(0);
    Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
    Mage::app();
    $Products = Mage::getModel('catalog/product')->getCollection()
->addAttributeToFilter(
      array(
         array('attribute'=>'price', 'eq'=>'0'),
         array('attribute'=>'price', 'isnull'=>true),
      )
);

   // remove categories

    foreach($Products as $product){
       Mage::getSingleton('catalog/category_api')->removeProduct($category->getId(),$product->getId());
    }

  // add category
foreach($Products as $product){


texts: Create Custom Shipping Method with Live Rates Magento 2

texts:
I have to integrate one shipping method with Magento 2 site.

For this I am following below link to create custom shipping method, but it's for static rate.

https://magenticians.com/create-magento-2-shipping-module-method/

In my case I have to get available shipping rates and lables using API. Can anyone please help?


texts: Multiple Database Records with Same Primary Key

texts:
I need to store relationships where a single attribute_id may be visible in multiple store_id and I was trying to use attribute_id as the primary key. It would be something like this:

+--------------+----------+
| attribute_id | store_id |
+--------------+----------+
| 147          | 1        |
| 147          | 2        |
+--------------+----------+

But Magento doesn't see that with good eyes as it returns the exception Item (foo) with the same ID "x" already exists.

What is the best solution for that problem?


texts: Override the functionality of updatecart.phtml in magento 1.9

texts:
I want to override the functionality of app/design/frontend/rwd/default/template/checkout/cart/item/configure/updatecart.phtml with my custom.phtml

Any suggestion.

Till know i have tried these code by putting it in local.xml but didn't work.

 <checkout_cart_configure translate="label">
        <label>Configure Cart Item</label>
        <update handle="catalog_product_view"/>
        <reference name="product.info">
            <block type="checkout/cart_item_configure" name="checkout.cart.item.configure.block" template="checkout/cart/item/configure/custom.phtml"></block>
        </reference>
</checkout_cart_configure>


texts: Magento 2 :- Checkout Page Postcode validation rule

texts: I tried to change the post-code validation on the checkout page, but I can not find any solution. So please help me with it.How to change the validation rules on it my module.


texts: I want to write custom api for getting shipping charge from magento DB. How to query shipping charge from magento DB in php.


texts: i'm trying to add partial payment for magento 2, any suggestion in modifying the order state, or maybe a good tutorial on making module that integrate with the admin sections, thanks.


texts: Increase Bestsellers Report limit Magento 1.7

texts:
I'm trying to increase the report limit of the Reports > Product > Bestsellers and Reports > Customers > Customers by order total. Default is set to 5 max.

Now I thought this was done by editing the $_ratingLimit value from (5) to (whatever) (Mage_Sales_Model_Resource_Report_Bestsellers_Collection), but this doesn't work for me.

Anyone have the quick fix?

Thanks


texts: Magento 2 : Unable to Redirect in Checkout Page With Paypal Payment Pro

texts:
I have set up paypal payment pro with magento 2, during test transaction when i fill test credit card details and click on place order, it redirect me to same page.
I have check the log file in var/log debog.log and got this response

'result' =>
  array (
    'result' => '0',
    'respmsg' => 'Approved',
    'securetoken' => '9f7MCv6ww3kWePtSJepWWfAJZ',
    'securetokenid' => 'b432b4bbeb4e9070369da658ced5e718',
    'result_code' => '0',
  ),
) {"is_exception":false} []


texts: How to edit "This Shipping method is currently unavailable" message

texts:
In Magento 1.9 we need to edit message "This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us."

This message is displayed when the "Proceed to shipping method" button is clicked, while a shipping address was entered incorrectly (like zip doesn't match state) and user still selected that address as a shipping address.

So we want to change the message correspondingly (something like "We cannot find the address specified, please correct it.").

I have found "This shipping method is currently unavailable..." message in so many places and edited the message in all of them:

app/code/community/Shipperhq/Shipper/etc/config.xml
app/code/core/Mage/Shipping/etc/config.xml
app/code/core/Mage/Usa/etc/config.xml
app/code/core/Mage/Shipping/Model/Rate/Result/Error.php

I created "local" copies of those config.xml and the Error.php files in case they would override the core and community ones:

app/code/local/Shipperhq/Shipper/etc/config.xml
app/code/local/Mage/Shipping/etc/config.xml
app/code/local/Mage/Usa/etc/config.xml
app/code/local/Mage/Shipping/Model/Rate/Result/Error.php

I also found the message in Magento Admin:
System->Configuration->Sales->Shipping Method (so I changed the message in all the methods there)...

Flushed Magento Cache and Cache Storage...

But it still displays the same old message.

Please advice where and how to edit that persistent message "This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us." Thank you much in advance!


texts:
I have a problem regarding Magento 2.3.2.
On some products detail pages, which uses AJAX to load some images, the customer gets an error, when adding product to cart - "Your session has expired".

The Magento Log und Apache Log has no error.
Does Magento has any problems with Ajax Request via GET???


texts:
I've installed a theme in Magento 2.0.5 EE with composer with:

composer require snowdog/theme-blank-sass

Later i removed it with

composer remove snowdog/theme-blank-sass

but in the backend Stores->Configuration->General->Design it is still present.
So googling i've found the official guide to theme uninstall:

http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-theme-uninstall.html#instgde-install-uninst-theme-over

I installed the theme again with composer and then tried:

sudo -u www-data php bin/magento theme:uninstall frontend/Snowdog/blank

but after 20 minutes the output is

Enabling maintenance mode
Removing frontend/Snowdog/blank from database
Removing frontend/Snowdog/blank from Magento codebase

With xdebug i've found that the problem is at /vendor/magento/module-theme/Model/Theme/ThemeUninstaller.php at line 71 that actually try to remove theme files with composer.

how can i remove it manually?


texts: Product images not loading from correct source

texts:
After a server update, my website seems to be loading my product images from

https://www.website.com/media/catalog/product/cache/1/small_image/300x/5a2864daa28c93cda65b9e6c099e84e6/p/r/website-cappuccino-image1_1.png

and it brings me to a 404 page when I open the image in a new tab.

that's what it shows when I inspect the image. I have cleared all cache from the cache management.
Not sure how to fix this.

Any help would be greatly appreciated.

Thank you!


texts:
Please help me,
I want to know exactly how the Invalidate private content works?
the solution to invalidate private content?
example: when I add to cart in Magento 2, how to identify change data and update changes in Full Page Cache.
solution, not code.


texts: Magento 1.9: How to add specific customer group in drop down list as product attribute in admin

texts:
I am working on a project in which I have created a module to create custom
customer in manufacturer customer group now I want to add this manufacturer customer group as a product attribute to product so that when I create a product from admin there should be an drop down list from the manufacturer customer group to add the manufacturer of the product.


texts: display all store id and store name in custom admin module

texts:
I am new to the Magento and i am using Magento 1.8.

I am creating custom admin module that need to be display all the store id and store names in grid as like product grid.

I have created grid and everything working fine but, While displaying id and name in grid, I am not able to only store id and store name.

My Prepare collection function is as follow:

protected function _prepareCollection()
{
 $store = $this->_getStore();
 $collection = Mage::getModel('core/store')->getCollection();
 $this->setCollection($collection);
 parent::_prepareCollection();
 return $this;
}

And my prepare column function is

protected function _prepareColumns()
    {
            $this->addColumn('store_id', array(
                'header' => Mage::helper('foundation')->__('storeid'),
                'index' => 'store_id',
                'type' => 'store',
                'width' => '100px',
                'store_view'=> true,
                'display_deleted' => true,
            ));
            $this->addColumn('store_name', array(
                'header' => Mage::helper('foundation')->__('store name'),
                'index' => 'name',
                'type' => 'store',
                'width' => '100px',
                'store_view'=> true,
                'display_deleted' => true,
            ));

        return parent::_prepareColumns();
    }

Now I am getting result as follow

How can I display only store id and store name in the grid?
Help me friends, I am new to the Magento.
Thanks in Advance..


texts: Shash (/) in SKU is stopped search in Magento 2

texts:
I have an issue with Magento search . I have a slashes in sku , and when i am trying to search specific product for example "ABCD/4" it shows ABCD/4 and ABCD/2
Its magento problem?

Please help , Thanks!


texts: How to get simple product id from configurable options in Magento 2?

texts:
I'm looking for a way to get the product Id of simple product using configurable options. I've following configuration options:

Material (as a select box)
Swatch color (As swatch)
Ring size (as a select box)

Is there any function in Magento2 through which I can achieve this?


texts: Is there an if/then condition in shopping cart promotions?

texts:
I am running 1.7.0.0, though that shouldn't matter too much. I am trying to create a promotion that discounts certain products if another product is purchased. In this case, if customer buys a certain music player and adds certain CDs to the order, the price of each CD would be discounted 10%. I've learned a lot this evening about what I can do with promotions, but I can't find anything like this.

Thank you,

John


texts:
I'd like to show a list of products on my homepage.
I've added a block in my layout.xml file and assigned a template to it. In this template I'm using a Helper Class.

Here's the code of my Helper Class:

namespace Vendor\Module\Helper;

class CategoryHelper extends \Magento\Framework\App\Helper\AbstractHelper {

    protected $_categoryFactory;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Catalog\Model\CategoryFactory $categoryFactory,
        array $data = []
    )
    {
        $this->_categoryFactory = $categoryFactory;
        parent::__construct($context, $data);
    }

    public function getCategory($categoryId)
    {
        $category = $this->_categoryFactory->create();
        $category->load($categoryId);
        return $category;
    }

    public function getCategoryProducts($categoryId)
    {
        $products = $this->getCategory($categoryId)->getProductCollection();
        $products->addAttributeToSelect('*');
        return $products;
    }

}

Here's the code of my .phtml file:

$categoryProducts = $block->getCategoryProducts( 8 );

foreach ($categoryProducts as $product) {
    echo $product->getName() . ' - ' . $product->getProductUrl() . '<br />';
}

No matter what ID I use, magento 2 shows up the following error message:

  Exception #0 (Exception): Warning: Invalid argument supplied for foreach() in [...]/app/design/frontend/Vendor/Module/Magento_Theme/templates/page/home/single_category.phtml on line 5

UPDATE:

I have changed the .phtml file to:

$categoryProducts = $this->helper('Vendor\Module\Helper\CategoryHelper')->$block->getCategoryProducts( "8" );

Now I get the following exception:

  Exception #0 (Exception): Recoverable Error: Argument 1 passed to Vendor\Module\Helper\CategoryHelper::__construct() must be an instance of Magento\Framework\App\Helper\Context, instance of Magento\Backend\Block\Template\Context given, called in [...]/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in [...]/app/code/Vendor/Module/Helper/CategoryHelper.php on line 10

I've also updated the Helper Class and changed the vartype from $context to Magento\Framework\App\Helper\Context...


texts: magento front end pagination not working for custom table join query collection

texts:
i working with the custom collection pagination, its working much good for single table collection, but for the join query collection, the pagination is not working, below i give as much a information for your further consideration.

i having two table

flquestion(table 1):
-------------------
question_id
question_title
question_description
question_category

flquestion_answer(table 2) (one question have a multiple answers)
-------------------------
answer_id
quesiton_id
answer_description

my query using query buider :

SELECT `main_table`.*, COUNT(main_table.question_id) AS `total_answer` FROM `flquestion` AS `main_table` LEFT JOIN `flquestion_answer` AS `answer` ON main_table.question_id = answer.question_id where main_table.status=1 GROUP BY `main_table`.`question_id` ORDER BY `main_table`.`question_id` desc

when i run this query i got the full result (nearly 7 records having), but the pagination not working properly , for more information see below my screen shot and the block file code

code in block file

public function __construct()
{
    parent::__construct();
    $collection = Mage::getModel('flquestion/question')->getAllQuestion();
    $this->setCollection($collection);
}

public function getPagerHtml()
{
    return $this->getChildHtml('pager');
}

protected function _prepareLayout()
{
    parent::_prepareLayout();
    $pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
    $pager->setAvailableLimit(array(5=>5,10=>10,20=>20,'all'=>'all'));
    $pager->setCollection($this->getCollection());
    $this->setChild('pager', $pager);
    $load = $this->getCollection()->load();
    return $this;
}

screen shot


texts: Cleared core_url_rewrites and lost custom urls

texts:
I was having an issue with the urls on the frontend with numbers like "-1" appending to the end of my product's url keys. I completely cleared out the core_url_rewrites and reindexed however now the full system url is appearing. I'm not sure how I can now get back my custom product urls. Is there another step to this that I am missing?  I believe my settings in configuration->catalog->search engine optimization are correctly set.

Use Categories Path for Product URLs = no

Create Permanent Redirect for URLs if URL Key Changed = yes

Any help to get my urls to appear like example.com/product-url or example.com/catagory/product-url  would be awesome.  Thank you!


texts: Calling same overridden custom class from 2 modules

texts:
I have a custom overriden class say Result.php overridden from CatalogSearch module.

Now if i have to use this Result class in 2 different modules(Module1 and Module2), do i have to override the class in both the modules (in the 'type' attribute of di)??

etc/di of Module1:

<preference for="Magento\CatalogSearch\Block\Result" type="Vendor/Module1/Block/Result">

etc/di of Module2:

<preference for="Magento\CatalogSearch\Block\Result" type="Vendor/Module2/Block/Result">

In the above case, if i want to track as to which Result from my custom module is getting called?

PROBLEM:

I tried echo in Module1's Result class somefun(), i get it, but i comment out the same and try in Module2's Result class somefun(), i dont get

Why?

Can i use something like this in Module2 di.

<preference for="Magento\CatalogSearch\Block\Result" type="Vendor/Module1/Block/Result">

I gave module1 in type


texts: Price inclusive and exclusive of tax are the same in catalogue and shouldn't be

texts:
I have a part with a 20c price. This price is exclusive of GST/Tax.
When I checkout, the basket has the product displaying  as 22c which is great.
The checkout totals and sub totals are all handling the GST/Tax correctly, but the product in the catalogue is showing as 20c.
I've set it up for display purposes to show both the ext and incl values, and they are both 20c.
Any thoughts on getting the actual Incl Tax to display in the catalogue would be appreciated.
Configuration Tax Settings:

Tax Calculation Method based on: Row Total Tax Calculation Based On:
Billing address Catalog Prices: Excluding Tax
Enable Corss Border Trade: No
Default Country: Australia Default State: * Default Post Code: 2280
Display Product Prices in Catelog: Including and Excluding Tax

If I've missed relevant settings please comment and I'll add them.


texts: Magento 2: Difference between adding object in Constructor and adding via object Manager?

texts:
In Magento 2, What is the main difference between adding an object in Constructor and adding via object Manager?

Adding an object in Constructor:

public function __construct(
    Magento\Indexer\Model\Processor $processor
){
    $this->_processor = $processor;
}

Adding via Object Manager:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$objectManager->create('Magento\Indexer\Model\Processor')


texts: Should I re-use models or create another block if model fulfill my purpose in a phtml file?

texts:
Why blocks are being made if models being re-used is considered better than create a new block with same functionality?
And if not,why not use a model,I believe re-using is a good coding practice


texts: Magento 2: Problem creating search request with REST API : V1/customers/search

texts:
I'm trying to make a search request which returns all the customers, but the php script below returns :

[message] => %fieldName is a required field.
[parameters] => Array
    (
        [fieldName] => searchCriteria
    )

My PHP script :

<?php

$search = '
{
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "name",
                        "value": "%",
                        "condition_type": "like"
                    }
                ]
            }
        ],
        "current_page": 1,
        "page_size": 1
    }
}
';

$token = "xxxxxxxxxxxxxxxxx";

$api = "rest/V1/customers/search";

$ch = curl_init("http://my.website.com/index.php/".$api);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $search);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer ".$token));

$result = curl_exec($ch);

$result = json_decode($result, 1);

print_r($result);

?>

What's wrong with this request ?

This other way to write this request works fine:

curl -X GET "http://my.website.com/index.php/rest/V1/customers/search? \
searchCriteria[filterGroups][0][filters][0][field]=email& \
searchCriteria[filterGroups][0][filters][0][value]=%& \
searchCriteria[filterGroups][0][filters][0][condition_type]=like" \
-H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxx" \
-H "Content-type: application/json" -g


texts: turn on/off the module just for a specific website

texts:
How to turn on/off custom third party extension website specific.

From backend System > Configuration > Advanced > Advanced it just return false front end output. what are other options.


texts: Dynamic rows grid. Position element is not initiating

texts:
Continuously appearing problem with the position element of the dynamic rows component if we wanna use drag&drop feature. For reference I use a Related Products rows grid at the Product edit form. In that js configuration a position field has visible = false property but nevertheless it is initiating properly  via registry.async() in vendor/magento/module-ui/view/base/web/js/dynamic-rows/record.js file function.

I spent a lot of hours trying find out why is my position element is not initiating but with no results.
Has anyone also faced with this annoying issue?

Here is an example of what I am trying to achieve:

But in my case I've got this:


texts: Database error when i tried to add states in 'Default Tax Destination Calculation'

texts:
I am trying to add the States of India through database so that it will be available under the option system->configuration->sales->tax/Default Tax Destination Calculation in magento 1.9.2.2.

I logged into cPanel. Then to database and then to directory_country_region table and clicked on the SQL tab and added the following code

INSERT INTO `directory_country_region` VALUES
(NULL , 'IN', 'AN','Andaman and Nicobar Islands'),
(NULL , 'IN', 'AP','Andhra Pradesh'),
(NULL , 'IN', 'AR','Arunachal Pradesh'),
(NULL , 'IN', 'AS','Assam'),
(NULL , 'IN', 'BR','Bihar'),
(NULL , 'IN', 'CH','Chandigarh'),
(NULL , 'IN', 'CT','Chhattisgarh'),
(NULL , 'IN', 'DN','Dadra and Nagar Haveli'),
(NULL , 'IN', 'DD','Daman and Diu'),
(NULL , 'IN', 'DL','Delhi'),
(NULL , 'IN', 'GA','Goa'),
(NULL , 'IN', 'GJ','Gujarat'),
(NULL , 'IN', 'HR','Haryana'),
(NULL , 'IN', 'HP','Himachal Pradesh'),
(NULL , 'IN', 'JK','Jammu and Kashmir'),
(NULL , 'IN', 'JH','Jharkhand'),
(NULL , 'IN', 'KA','Karnataka'),
(NULL , 'IN', 'KL','Kerala'),
(NULL , 'IN', 'LD','Lakshadweep'),
(NULL , 'IN', 'MP','Madhya Pradesh'),
(NULL , 'IN', 'MH','Maharashtra'),
(NULL , 'IN', 'MN','Manipur'),
(NULL , 'IN', 'ML','Meghalaya'),
(NULL , 'IN', 'MZ','Mizoram'),
(NULL , 'IN', 'NL','Nagaland'),
(NULL , 'IN', 'OR','Odisha'),
(NULL , 'IN', 'PY','Puducherry'),
(NULL , 'IN', 'PB','Punjab'),
(NULL , 'IN', 'RJ','Rajasthan'),
(NULL , 'IN', 'SK','Sikkim'),
(NULL , 'IN', 'TN','Tamil Nadu'),
(NULL , 'IN', 'TG','Telangana'),
(NULL , 'IN', 'TR','Tripura'),
(NULL , 'IN', 'UP','Uttar Pradesh'),
(NULL , 'IN', 'UT','Uttarakhand'),
(NULL , 'IN', 'WB','West Bengal');

Now I am getting the error,

  #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `directory_country_region` VALUES
  (NULL , 'IN', 'AN','Andaman and N' at line 2


texts:
I need the list of payment method codes.

My code

<?php
require_once("../app/Mage.php");

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
Mage::init();
echo "start
";

$allPaymentMethods = Mage::getModel('payment/config')->getAllMethods();

foreach($allPaymentMethods as $pippo) {
    echo $pippo;
}

echo count($allPaymentMethods);
echo "
";
$activePaymentMethods =Mage::getModel('payment/config')->getActiveMethods();

foreach($activePaymentMethods as $menelao) {
    echo $menelao;
}
echo count($activePaymentMethods);
echo "
";

echo "end";
?>

It does not work. The array count works but echo $pippo and $menelao is blank.

Why?


texts: Proper way to get product collection with store specific values in admin area

texts:
For a custom indexer, I need to load a product collection with the attribute values for a given store, while not in a store context.

As it has been established in Magento 2: How to Filter a Product Collection By Store ID, ProductRepository::getList() does not have a store id parameter and also does not understand store_id as filter in the SearchCriteria parameter.

In the comments above, @IgorMinyaylo explains that in the REST APIs it is done by the store id URL part:

http://<magento_host>/rest/<store_code>/

So I looked how the Webapi module processes this part and found:

/**
 * Process path info
 *
 * @param string $pathInfo
 * @return string
 * @throws NoSuchEntityException
 */
public function process($pathInfo)
{
    $pathParts = $this->stripPathBeforeStorecode($pathInfo);
    $storeCode = $pathParts[0];
    $stores = $this->storeManager->getStores(false, true);
    if (isset($stores[$storeCode])) {
        $this->storeManager->setCurrentStore($storeCode);
        $path = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
    } else if ($storeCode === self::ALL_STORE_CODE) {
        $this->storeManager->setCurrentStore(\Magento\Store\Model\Store::ADMIN_CODE);
        $path = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
    } else {
        $path = '/' . implode('/', $pathParts);
    }
    return $path;
}

The relevant line is:

        $this->storeManager->setCurrentStore($storeCode);

But this sets the "current store" as global state. This is fine for an API request, but I would rather avoid it when I'm actually in admin or cron context. The risk of undesired side effects is too high.

I also looked at the core indexers but those operate on a level of implementation detail which would not be a good fit for an extension.

So how can I achieve the same without $storeManager->setCurrentStore()? Do I have to construct my collection manually instead of using the repository? Can I use store emulation?

In Magento 2: Can you Filter By store_id Using a Product Repository a plugin for the product collection is proposed as fix, which makes it possible to add store_id as SearchCriteria parameter. It's good enough as a workaround, but does not seem "right" to me.


texts: Magento 2 referrer URL not working and also product not adding to cart

texts:
https://hofindia.com/hof/customer/account/login/referer/aHR0cHM6Ly9ob2ZpbmRpYS5jb20vaG9mLw%2C%2C/    This Url Not working and

https://hofindia.com/hof/customer/account/login/ It's Working

Also, Product not adding in cart sometimes because of this issue.

Kindly Do Needful. I am Stuck


texts:
I'm new to magento, have been using creloaded, figure it's time to move on to a new e-commerce platform and found this charm at last.

My website have 6 languages and 6 currencies, the base currency is USD and I have GBP, EUR and so on. I do post my products onto Google Base regularly. My problem is I need to be able to specify the currency in URL, i notice each time when we switch currency, the url stay the same and, I would like to know how to set the currency with url?


texts: On completion of an order, I would like to trigger a refresh of a certain Customer Segment. What method could I call to accomplish this? Thanks!


texts: Magento 2. Magento\Framework\View\Element\Text is not rendering

texts:
I'm trying to use the Magento\Framework\View\Element\Text block, in a custom view but the output is not rendering.

This is my layout file

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block name="custom.test.block" template="Vulpea_Frontend::test.phtml" />
            <block name="some.custom.text.block" type="Magento\Framework\View\Element\Text">
                <action method="setText">
                    <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">Some Custom Text</argument>
                </action>
            </block>
        </referenceContainer>
    </body>
</page>

My debugging so far:

The layout file is correctly used. The page is accessible in storefront and the other block is rendering just fine.
The Text block is added to the layout. I can see it in the $_blocks property of the Magento\Framework\View\Layout class. The text is there as well as a property of the block.
For some whatever reason the _toHtml() method of the my custom text block is never called. It is however called for other text blocks on the page store.links for example.

My Questions (no need to answer to all of them):

Am I wrong in expecting this block to render automatically? Does this block need a template? Should I put this block in a parent block and call it manually?

How should I proceed in fixing or debugging this?

BTW the whole module is visible here


texts: payment-information 400 bad request when product quantity is bigger (or equal) than 3

texts:
I've recently reviewed a lot of 400 errors on payment-information API

My problem is a little different, since it happens only when the product quantity is 3 or more.

I select the shipping method (the problem occurs with all shipping methods) and when I click the "place order" button I got this error (sorry the language is Italian)

if I set the amount to 2 or less (even for multiple products) the order is placed correctly.

So it's OK to buy:

2 item A
1 item B
2 item C

but it is not OK to buy:

3 items A
1 item B
2 items C

I'm unable to debug this issue, since the only trace I get is this one:

  #0 [*MAGENTO_PATH*]/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Checkout\Model\PaymentInformationManagement->savePaymentInformationAndPlaceOrder(34, Object(Magento\Quote\Model\Quote\Payment), Object(Magento\Quote\Model\Quote\Address))↵#
    #1 [*MAGENTO_PATH*]/var/generation/Magento/Checkout/Model/PaymentInformationManagement/Interceptor.php(26): Magento\Checkout\Model\PaymentInformationManagement\Interceptor->___callPlugins('savePaymentInfo...', Array, Array)↵#
    #2 [internal function]: Magento\Checkout\Model\PaymentInformationManagement\Interceptor->savePaymentInformationAndPlaceOrder(34, Object(Magento\Quote\Model\Quote\Payment), Object(Magento\Quote\Model\Quote\Address))↵#
    #3 [*MAGENTO_PATH*]/vendor/magento/module-webapi/Controller/Rest.php(307): call_user_func_array(Array, Array)↵#
    #4 [*MAGENTO_PATH*]/vendor/magento/module-webapi/Controller/Rest.php(216): Magento\Webapi\Controller\Rest->processApiRequest()↵#
    #5 [*MAGENTO_PATH*]/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(37): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))↵#
    #6 [*MAGENTO_PATH*]/vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))↵#
    #7 [*MAGENTO_PATH*]/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()↵#
    #8 [*MAGENTO_PATH*]/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))↵#
    #9 {main}

but no actual errors are stored in logfiles.

Can someone help me debug this problem?

Thanks a lot

UPDATE 1:
The system is crashing with the error message "you cannot order more than 5 items" (max order size is set to 5 by me)
If I order 3, 4 or 5 I get this error in the e->getMessage() of the exception thrown by magento/module-checkout/Model/PaymentInformationManagement.php:71
If I order more than 5 items I get the standard frontend error. is it possible that the amount of items is doubled when I order a Simple product associated to a Configurable product?


texts: Magento on shared hosting and ' Full Page Cache'

texts:
If Magento is hosted on a shared server and 'PageCache powered by Varnish' is out of the question, would anyone recommend some of the other Magento page cache plugins like:

Booster: http://www.magentocommerce.com/magento-connect/performance-booster.html

Zoom: http://www.magentocommerce.com/magento-connect/zoom-full-page-cache-1742.html

Nitrogento: http://www.nitrogento.com/

Brim: http://ecommerce.brimllc.com/full-page-cache-magento.html

[update]

Lesti: http://www.magentocommerce.com/magento-connect/lesti-fpc-4534.html
(free)

Are they all 'just not worth it'?, is there one that stands out from a bad bunch?

Cheers,

Les


texts: Fatal error when I enable filter => true in addColumn

texts:
I've been able to filter based on custom addColumn to sales_order_create_search grid.

Custom Added Column

$this->addColumn('seller_id', array(
        'header' => Mage::helper('marketplace')->__('Seller Names'),
        'index' => 'seller_id',
        'filter'    => true,
        'sortable'  => true,
        'renderer'  =>   'adminhtml/sales_order_create_search_grid_renderer_sellername'
    ));

filter => false code is working fine list products with seller names but when try to enable filter => true its generating Fatal error

  exception 'Mage_Core_Exception' with message 'Invalid block type: 1'
  in C:\wamp\www\magetno\app\Mage.php:595 Stack trace:
  C:\wamp\www\magetno\app\code\core\Mage\Core\Model\Layout.php(495):
  Mage::throwException('Invalid block t...')

  C:\wamp\www\magetno\app\code\core\Mage\Core\Model\Layout.php(437):
  Mage_Core_Model_Layout->_getBlockInstance(true, Array)

  C:\wamp\www\magetno\app\code\core\Mage\Adminhtml\Block\Widget\Grid\Column.php(369):
  Mage_Core_Model_Layout->createBlock(true)

  C:\wamp\www\magetno\app\code\core\Mage\Adminhtml\Block\Widget\Grid\Column.php(51):
  Mage_Adminhtml_Block_Widget_Grid_Column->getFilter()

  C:\wamp\www\magetno\app\code\core\Mage\Adminhtml\Block\Widget\Grid.php(314):
  Mage_Adminhtml_Block_Widget_Grid_Column->setGrid(Object(Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid))

  C:\wamp\www\magetno\app\code\local\Mage\Adminhtml\Block\Sales\Order\Create\Search\Grid.php(156):
  Mage_Adminhtml_Block_Widget_Grid->addColumn('seller_id', Array)

  C:\wamp\www\magetno\app\code\core\Mage\Adminhtml\Block\Widget\Grid.php(624):


texts: How could I install correctly the Magento Devbox on my Linux (Ubuntu)?


texts: PayPal IPN: some orders produce IPN failure ( Undefined index: invoice )

texts:
I've tested a PayPal order (using standard One Page Checkout and core Paypal Payments Standard) when IPN is enabled and the statuses update fine so IPN seems to function.

However, PayPal sends through this email periodically:

  Dear xxxx,

  Please check your server that handles PayPal Instant Payment
  Notifications (IPN). Instant Payment Notifications sent to the
  following URL(s) are failing:

  http:// xxxx /paypal/ipn/

  If you do not recognize this URL, you may be using a service provider
  that is using IPN on your behalf. Please contact your service provider
  with the above information. If this problem continues, IPNs may be
  disabled for your account.

  Thank you for your prompt attention to this issue.

  Yours sincerely, PayPal

and then after about a week automatically disables IPN which stops PayPal orders from updating properly.

Checking system.log shows a bunch of notices

2014-02-12T20:29:54+00:00 ERR (3): Notice: Undefined index: invoice  in /var/www/windswept/app/code/core/Mage/Paypal/Model/Ipn.php on line 171

There are about 50 of these errors ( one every 15/20 min) while we had a small amount of Paypal orders recently.

Does anybody have any insight into this issue?


texts:
WE are using magento 2.3.3 p1 EE version to one of our site.Url doesn't contain the store code before we switch the store code.
How to display the home page URL with store code


texts: Magento2 Category page with color swatches loading too slow

texts:
I am using Magento 2.3.5-p1 along with  Elastic Load Balancer , My application is hosted in 8GB RAM and 160GB space and MYSQL also hosted on another VM with 8GB ram.
I have 40,000 products which all are virtual products with 500 configurable products. In front end only showing these 500 products with color swatches. When i hit the category pages, its almost taking 12-16 seconds to load those pages.
I want to increase the performance of category pages. What type of optiomizations i can do here. I googled and tried
Disable count on layer navigation
Enabled HTTP2
Enabled CDN for static and media files

But none of the above not speed up my page. Also tried with mod_pagespeed but it crashed my admin panel of magento2 products. So i disabled that mod_pagespeed.


texts: Cannot access Manage Categories in admin. Source model not found for attribute error

texts:
We had an issue with an old instance and basically, our SSH root was corrupt and we couldn't upgrade any longer. So, I took a database backup and installed it on a fresh installation. I then added our new theme, and everything seemingly works fine but when I try to access the Manage Categories area in admin.  I get the error pasted at the end of this post.

It looks like it is basically looking for something from our old theme, which in retrospect, perhaps I should've reverted to the default Magento theme before doing the DB backup I used to restore on this fresh instance, but live and learn.

To remedy the issue I did the following:

Deleted the record looking for the attribute ico_page_heading_textalign in the database. That did nothing.
Deleted all records referring to Atelier, our old theme. That took the whole darn thing down :)
Restored the whole site to before I started this exercise.
Uploaded all the files/folder (named Icotheme) from my old theme into the app>code>local folder, including the file from the error.

Here is the error:

a:5:{i:0;s:126:"Source model "icotheme/system_config_source_category_attribute_textalign" not found for attribute "ico_page_heading_textalign"";i:1;s:4538:"#0 /var/www/html/magento/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(390): Mage::exception('Mage_Eav', 'Source model "i...')

I still can't access the Manage Categories so I am hoping someone here can help!

Please see the entire error report below.

Thanks!


texts:
I am writing a simple extension that is designed to capture the data from an order once it has been placed on Magento. However, any code I write to my observer appears to get passed to the browser as JSON and causes the site to hang at the checkout. I tested the code by simply echoing "Hello World" and it did indeed appear as JSON in the browser.

"Uncaught SyntaxError: Unexpected token H in JSON at position 0"

Hello World"11"

app\code\Company\ServerSync\etc\events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_submit_all_after">
        <observer name="get_place_order" instance="Company\ServerSync\Observer\Order"/>
    </event>

app\code\Company\ServerSync\Observer\Order.php:

<?php

namespace Company\ServerSync\Observer;

    use Magento\Framework\Event\ObserverInterface;

class Order implements ObserverInterface {

    public function execute(\Magento\Framework\Event\Observer $observer) {
        echo "Hello World";
    }
}

I am fairly new to Magento, can anyone explain to me what I am doing wrong?


texts:
I need display category-block below product page in template file .phtml
But this code not work.
Can you help me?

$_helper = $this->helper('catalog/output');
$_product = $this->getProduct();
$html = $this->getLayout()->createBlock('cms/block')
                    ->setBlockId($this->getCurrentCategory()->getLandingPage())
                    ->toHtml();

        if (!$this->getData('cms_block_html')) {
            $html = $this->getLayout()->createBlock('cms/block')
                ->setBlockId($this->getCurrentCategory()->getLandingPage())
                ->toHtml();
             $this->setData('cms_block_html', $html);
        }
         return $this->getData('cms_block_html');


texts: Hide Tabs on product details page for specific product Magento2

texts: I have a specific type of product. And I want to hide the Tabs on product details page for that product specifically. Is it possible and what is the best way to do that.


texts: js files are automatically deleted - adminhtml/web/js/components/use-parent-settings

texts:
In my M 2.2.6  I can not enter the Category section of dashboard,
the spining is turn around.

When I check the console, some of JS has 404 error

In  -  adminhtml/web/js/components/use-parent-settings -

select.js
single-checkbox.js
textarea.js
toggle-disabled-mixin.js

I add it manual via SFTP then  run

bin/magento setup:static-content:deploy -f

Problem temporarily resolved, but after one day, I can not enter the category section on dashboard again. and again.

On the other hand
I can not set to production to run

 bin/magento deploy:mode:set production

It gives an error like

The directory "/srv/public_html/pub/static/adminhtml/Magento/backend/tr_TR/Magento_Catalog/js/components/use-parent-settings/toggle-disabled-mixin.js" cannot be deleted Warning!rmdir(/srv/public_html/pub/static/adminhtml/Magento/backend/tr_TR/Magento_Catalog/js/components/use-parent-settings/toggle-disabled-mixin.js): Not a directory

As it appears that the symlinks are part of your deployment system,  will need to fix the links to point to the appropriate place/file but I can not handle.

Any Suggestions?


texts:
I am trying to install magento-2.3.2 in my windows 10 64 bit system.

First of all I clone from magento 2.3.2 repo.

git clone https://github.com/magento/magento2.git

and then I run composer install to install all listed modules inside composer.json.

When I try to install Magento-2.3.2, in the last step I am getting this error.

Installation is incomplete.
Check the console log for errors before trying again.

  [ERROR] LogicException: Unknown module in the requested list:
  'Amazon_Core' in
  E:\xampp\htdocs\magento2\setup\src\Magento\Setup\Model\Installer.php:468
  Stack trace: #0
  E:\xampp\htdocs\magento2\setup\src\Magento\Setup\Model\Installer.php(427):
  Magento\Setup\Model\Installer->readListOfModules(Array, Array,
  'enable-modules') #1
  E:\xampp\htdocs\magento2\setup\src\Magento\Setup\Model\Installer.php(357):
  Magento\Setup\Model\Installer->createModulesConfig(Array, true) #2
  E:\xampp\htdocs\magento2\setup\src\Magento\Setup\Controller\Install.php(109):

Now, what's wrong with the amazon_core module that one can resolve?


texts:
Now, I need to allow upload an image for the titile/question of the custom option
and allow upload an image for each options of select option
and show dropdown menu as buttons for select option

But I cannot find the way to revise the custom option part of catalog edit form. Is there any way to change that part?


texts: Warning: is_readable() expects parameter 1 to be a valid path

texts:
I have been getting this error pointing to this function

protected function _checkSrcIsFile($src)
{
    $result = false;
    if (is_string($src) && is_readable($src) && is_file($src)) {
        $result = true;
    }

    return $result;
}

and the funtion is being passed here:

$srcIsFile = $this->_checkSrcIsFile($src);
if ($srcIsFile) {
    $src = realpath($src);
    $result = $this->cp($src, $filename);
} else {
    $result = $this->filePutContent($filename, $src);
}

if (!is_null($mode) && $result !== false) {
    $this->chmod($filename, $mode);
}

return $result;

can anyone explain to me what is causing this and what is the solution and how can I recreate it.

Thank you.


texts: category url rewrite doesn't work when magento running on nginx

texts: I set up my magento store running on LEMP server. Every thing works fine except the url rewrite of category does not work.  If I use the url http://mystore.com/catalog/category/view/id/3, then I can see the category view page.  But if I click the category on the top menu and its url is rewritten to http://mystore.com/website-sale.html.  Then the category page is missing. I got the '404' error message.


texts: How to call phtml file in all pages Magento 1 Module?

texts:
I am trying to call phtml file in all pages in module in magento 1
Is their any way to can implement it?


texts: Issue in Radios Button validation in magento

texts:
I added the radios field in magento admin form  but have problem in validation,it is showing the all radios are required, and if a option is selected giving me an error for other options.

here is my code:

<?php
$fieldset->addField('size', 'radios',
                       array(
                          'label' => Mage::helper('moduelname')->__('Maximum rim size you can handle
'),
                          'class' => 'required-entry',
                          'required' => false,
                           'name' => 'size',
                           'values' => array(array('value' => '17', 'label'=>'17 inch'),
                                       array('value' =>'18', 'label'=>'18 inch'),
                                       array('value' =>'19', 'label'=>'19 inch')
                                      ,array('value' =>'20', 'label'=>'20 inch')
                                      ,array('value' =>'21', 'label'=>'21 inch')
                                      ,array('value' =>'22', 'label'=>'22 inch')
                                      ,array('value' =>'23', 'label'=>'23 inch')
                                      ,array('value' =>'24', 'label'=>'24 inch')
                                      ,array('value' =>'25', 'label'=>'25 inch'),),
                    ));
?>


texts: Dynamic number of text fields when a value from dropdown is selected in Magento 2 system configuration backend

texts:
I have one drop down with fixed set of values lets call 1 to 5. when i select any number that many number of textboxes should be visible in the admin system configuration in magento 2.

for example. if i select 3 from drop down then i want to show 3 text boxes just below the dropdown. if i select 1 from drop down then one text box should be shown.

please help me how can i achieve this in Magento 2


texts: How to get coupon code in controller_action_postdispatch_checkout_cart_couponPost event

texts:
I want to do some customisation to cart on submit coupon code from cart, for this I added controller_action_postdispatch_checkout_cart_couponPost event and there I want to get coupon code and check its validation, if it is not valid then I want to apply some custom discount to cart.

But How to get coupon code here and check validity of it in event controller_action_postdispatch_checkout_cart_couponPost ?


texts: Magento 2.2.7 Order sales report Shows empty results

texts:
If I select Date Used as Order Created it show me

We couldn't find any records.


texts: Hide block of text if there are no items to compare

texts:
I'd like to display/hide a block of text by wrapping in a PHP IF Statement. Value will be based on whether Comparable Products is not equal to "0" (or NULL?). I imagine I'd be looking at something like:

app/design/frontend/Theme/theme_child/Magento_Catalog/templates/product/compare/link.phtml

<?php if ($INSERT_ANSWER()): ?>

You have products to compare

<?php else: ?>

<?php endif; ?>

I'd probably need to include a Helper as well.


texts: How to adjust the width of products in shipment pdf

texts: In Shipment PDF I want to make this (qty, products, sku)table width 280 px according to the top box, but I can't change the width of the product name, it should be fix within the table, but it's exceeding.


texts: Can't find "Admin account sharing" in admin panel

texts:
I want to setup the Functional Test Framework for Magento 2. based on Magento Docs I should make some changes in Admin here:
 but it seems the field "Admin Account Sharing" has been disappeared from there! here is my Admin screenshot! Does anyone know how should I fix it?


texts: Individual Image for Grouped Products Magento 2 Ultimo Theme

texts: Please help. Not able to see the individual photo for grouped products. Only appears in the cart but not the product page.


texts:
How can make the customer pick the price of a product?

Is it possible to define price steps for this? Like 5€, 10€, 15€, 20€


texts: How to make checkout a static block / have identifier like static blocks or pages?

texts:
Can I make magento checkout to have an identifier/ID like static blocks and pages?

What's the best practice or solution to do this?

I'm currently calling out magento pages / static blocks through API calls on my vuejs PWA by "identifiers".

Example:

    Cms content

  Cms page content

  (by identifier, it handles current store view if multistore is enable)

<cms-data :identifier="'about-us'" :type="'Page'"/>

Cms block content

  (by identifier, it handles current store view if multistore is enable)

<cms-data :identifier="'contact-us-info'" :type="'Block'"/>


texts: Use CDN url instead of image path with mysql bulk import

texts:
I want to insert and use an image urls from my own CDN directly into the database. I want to do this to save space because I use the images in other applications as well.

I've wrote a function that populates this two tables:
catalog_product_entity_media_gallery
and
catalog_product_entity_media_gallery_value.

This is what I've inserted as value : http://cdn.domain.com/products/nike/448224-010-00.jpg, while this is the way magento does: /4/4/448224-010-00.jpg

So far so good. But now magento creates an url like this: http://www.domain.com/media/catalog/product/http://cdn.domain.com/products/nike/448224-010-00.jpg

Is there a way to tell magento (extension or module) not to use the media folder and base url? I also want the width or height to be added to the url when it's called.

Add querystring like this: ?w=100&h=100


texts: Magento 2 - How to config to change layout and ui_component of module core

texts: I've just changed new layout admin: customer_index_index.xml and change ui_component/customer_list.xml. And now, How to config to change layout and ui_component?


texts: How do SalesRules actions evaluate category values?

texts: I briefly stepped through some of the SalesRule scenarios and code, and it seems like anything dealing with category params is ignored. On the one hand, this makes sense, as quote items have no concept of categories. On the other hand, why is this an option?


texts:
I have created multi store view from backend.
1- store1
2- store2
Now when i add product from store1 and switch store view to store2 then it shows that added product from store1 into the cart. Now when i created two sub domains for store views
1-store1.mysite.com
2-store2.mysite.com
and configured it on store > configuration > web > store wise base url also made changes in host and vhost file of apache below is vhost configuration.
<VirtualHost *:80>
    ServerAdmin webmaster@store1.mysite.com
    DocumentRoot "C:/xampp72/htdocs/projects/mysite/pub"
    ServerName store1.mysite.com
    SetEnv MAGE_RUN_TYPE "store"
    SetEnv MAGE_RUN_CODE "stoe1"
    ErrorLog "logs/store1.mysite.com-error.log"
    CustomLog "logs/store1.mysite.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@store2.mysite.com
    DocumentRoot "C:/xampp72/htdocs/projects/mysite/pub"
    ServerName store2.mysite.com
    SetEnv MAGE_RUN_TYPE "store"
    SetEnv MAGE_RUN_CODE "store2"
    ErrorLog "logs/store2.mysite.com-error.log"
    CustomLog "logs/store2.mysite.com-access.log" common
</VirtualHost>

and did same thing add product from store1.mysite.com and switch to store2.mysite.com then it doesn't show that product into the cart.
Basically i want customer to share common cart for all store view with multiple subdomains.
Note: i also changed customer configuration Share Customer Accounts to global


texts: I want to run an Event Observer once after my custom module is installed

texts: Is there a way to run a function (to call an api) once after a module is installed? It could be during admin page load or in the install script. But i wish to run only once. Thanks


texts:
I have an installation of Magento 1.9.2. I am using a custom theme, and anytime I try and place an order it kicks off the ajax on the page and then stops with no error messages, but does leave a log:

  ERR (3): User Error: Some transactions have not been committed or
  rolled back  in /html/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 4039

I have spent 2 days trying to get to the bottom of this with no joy. It doesnt matter what payment method I use its always the same.

Any help would be gratefully appreciated


texts: how to add a google recaptcha to sign-in form in the frontend

texts:
i am using Magento 2.2 , in terms of security i want to add a Google reCAPTCHA to sign-in form for the customers to create their accounts , so i need to add google reCAPTCHA to this form to check if they are robots or a humans.

can anyone help me please ?


texts: Fresh Magento 2 install admin does not give login box

texts:
I'm fairly new to Magento 2 and have been attempting to add a copy on my local machine (operating system: Windows 10) so that I can try out some database migration tests.

I have installed XAMPP and proceeded with the installation instructions. I was then rewarded with the following screen:

The actual site address seems to open a follows:

However when I click on "Launch Magento Admin" I get taken to a blank screen:

I've opened the developers console to see if anything is wrong and the following errors seem to be in effect:

Looking at this, I would think that this is an effect of the adminhtml styles not being loaded.

Regardless, does anyone know how I can fix this?


texts:
I'm attempting to migrate a store from GoDaddy to Nexcess.  The tool is failing on migrate:settings for reasons Nexcess can't resolve.  They've (been really really great) only done migrations locally moving from localhost to localhost.  I'm not doing that, and am not sure the Migration Tool can handle what I'm asking?

The thing is, sassyboutique.com isn't our site, but our hosts doesn't think the problem is on their end.

My code from the config.xml file:

<source>
    <database host="107.xxx.xxx.xxx" name="fxxx" user="fxxx" password="fxxxx"/>
</source>
<destination>
    <database host="173.xxx.xxx.xxx" name="fzzz" user="fzzz" password="fzzzz"/>
</destination>

I've verified the info with Nexcess basically just the IP to connect to and the DB info.  I'm using the IP addy's that both hosts are providing.  On the local side with Nexcess I've also used 'localhost' and 127.0.0.1 but all fail.

I can find no instances of this happening.  Anyone have any idea whats causing this?


texts: Magento 2 Text swatch options label not getting displayed

texts:
Magento 2 I am programmatically adding text swatch options but label is not getting displayed.

I have referred links where many such issues are mentioned faced by different people

Magento 2 : How to save swatch_text attribute options programatically?

Can someone guide me know how to solve this issue?
Following is the code I have used?
  $attributeDetails = $objectManager->create('MagentoEavModelConfig')->getAttribute("catalog_product", $attributeCode);
    //print_r($attributeDetails->getId()); exit();
    $attributeId = $attributeDetails->getId();
    $languageValues[0]=$label;
    $languageValues[1]=$label;
    /* @var $attr MagentoEavModelEntityAttribute */
    $attr = $objectManager->create('MagentoEavModelEntityAttribute');
    $attr->load($attributeId);
    $option = [];
    $option['value'][$languageValues[0]] = $languageValues;
    $attr->addData(array('option' => $option));
    $attr->save();


texts:
I have a Controller that contains the following:

...

use Magento\Backend\App\Action;
use Magento\TestFramework\ErrorLog\Logger;
use Magento\MediaStorage\Model\File\UploaderFactory;
use MyNamespace\Slider\Model\SliderImage;

class Save extends \Magento\Backend\App\Action
{

    /** @var UploaderFactory */
    protected $uploaderFactory;

    /** @var SliderImage */
    protected $imageModel;

    public function __construct(
        Action\Context $context,
        UploaderFactory $uploaderFactory,
        SliderImage $imageModel
    )
    {
        parent::__construct($context);
        $this->uploaderFactory = $uploaderFactory;
        $this->imageModel = $imageModel;
    }

    ...
}

I am using this to save a form in the admin. It was working properly without the UploaderFactory and SliderImage in the __contruct.

I am now trying to add an Image field to the form.
I have added the dependencies, UploaderFactory and SliderImage and now get the error:

  Uncaught TypeError: Argument 2 passed to MyNamespace\Slider\Controller\Adminhtml\Image\Save::__construct() must be an instance of Magento\MediaStorage\Model\File\UploaderFactory, none given, called in /var/www/html/generated/code/MyNamespace/Slider/Controller/Adminhtml/Image/Save/Interceptor.php on line 14 and defined in /var/www/html/app/code/MyNamespace/Slider/Controller/Adminhtml/Image/Save.php:19 Stack trace: #0 /var/www/html/generated/code/MyNamespace/Slider/Controller/Adminhtml/Image/Save/Interceptor.php(14): MyNamespace\Slider\Controller\Adminhtml\Image\Save->__construct(Object(Magento\Backend\App\Action\Context)) #1 /var/www/html/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(111): MyNamespace\Slider\Controller\Adminhtml\Image\Save\Interceptor->__construct(Object(Magento\Backend\App\Action\Context)) #2 /var/www/html/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('MyNamespace\Slider...', Array)


texts: Magento 2 - Checkout session empty in payment method

texts:
I'm modifying mercadopago module, and i need to work with the checkout session. When i use this function

$this->_checkoutSession->hasQuote()

It returns false. My class is:

class Payment
    extends \Magento\Payment\Model\Method\AbstractMethod

public function __construct(
        \MercadoPago\Core\Helper\Data $helperData,
        \Magento\Catalog\Helper\Image $helperImage,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Sales\Model\OrderFactory $orderFactory,
        \Magento\Framework\UrlInterface $urlBuilder,
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
        \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
        \Magento\Payment\Helper\Data $paymentData,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Payment\Model\Method\Logger $logger,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = []
    )
    {
        parent::__construct(
            $context,
            $registry,
            $extensionFactory,
            $customAttributeFactory,
            $paymentData,
            $scopeConfig,
            $logger,
            $resource,
            $resourceCollection,
            $data
        );

        $this->_helperData = $helperData;
        $this->_helperImage = $helperImage;

        $this->_checkoutSession = $checkoutSession;

So it should work, i read that it might be a cache problem, i disabled the cache from everywhere in Magento dashboard -> System -> Cache management but still no success.

How can I solve it? I just need to get the quote ID for a SQL query later. Of course without quote, the function getQuoteId() doesn't work. I tried logging the $checkoutSession but it is empty.

Thanks for your time


texts:
I've got some code in place on the Customer Grid that feeds in default_billing address lines:

->joinAttribute('billing_street', 'customer_address/street', 'default_billing', null, 'left')

I need to know how to split these into separate columns, for example instead of having "Address 1 Address 2" in the same column I need - | Address 1 | Address 2 | in 2 different columns.

Thanks


texts:
hello I have a problem again with my rewrite, I tried to rewrite the product view block

app/code/local/Lesson/Test/etc/config.xml

 <?xml version="1.0"?>
    <config>
        <modules>
            <Lesson_Test>
                <version>1.0.0</version>
            </Lesson_Test>
        </modules>
        <global>
            <blocks>
                <catalog>
                    <rewrite>
                        <product_view>Lesson_Test_Block_Catalog_Product_View</product_view>
                    </rewrite>
                </catalog>
            </blocks>
        </global>
    </config>

app/code/local/Lesson/Test/Block/Catalog/Product/View.php

<?php
Class Lesson_Test_Block_Catalog_Product_View extends Mage_Catalog_Block_Product_View
{
    public function afficherLesInfos()
    {
        return 'les infos complementaires';
    }
}

app/etc/modules/Lesson.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Lesson_Test>
            <active>true</active>
            <codePool>local</codePool>
        </Lesson_Test>
    </modules>
</config>

I tried to access

http://127.0.0.1/magento/magento-tutorial/index.php/
http://127.0.0.1/magento/magento-tutorial/index.php/lesson
http://127.0.0.1/magento/magento-tutorial/index.php/lesson/product
http://127.0.0.1/magento/magento-tutorial/index.php/lesson/product/view
http://127.0.0.1/magento/magento-tutorial/index.php/product/view
http://127.0.0.1/magento/magento-tutorial/index.php/lesson/catalog/product/view

no one of that at work


texts: I kept looking for days to find a way to fill the product title (in the backend product add/edit form) field automatically based on values that i choose on different custom attributes.


texts: Magento record count memory size of 268435456 bytes exhausted error

texts:
I having a custom table with 5lakhs records, i am writing query and get count of row using $collection->getCount() method, but it throw an error

  Fatal error: Allowed memory size of 268435456 bytes exhausted.

Table (id,firstname,lastname,address)

this table having 5lakhs records

$collection = $this->getCollection();
            echo $collection->getCount(); exit;
            if($collection->getCount()) {
                foreach($collection as $_collection) {
                    $this->email[$_collection->getEmail()] = $_collection->getId();
                    $this->f_name[$_collection->getFirstname()] = $_collection->getId();
                    $this->l_name[$_collection->getLastname()] = $_collection->getId();
                }
            }

Here i wrote this query in that corresponding table model file,that why use the $this object.

i also increase my max_memory limit to 1024M in my php.ini file.


texts:
In my one-col phtml I echo this

<?php echo $this->getChildHtml('nav') ?>

and in my local layout xml, I have this.

<layout>
    <default>
        <reference name="nav">
             <block type="core/text_list" name="nav" template="nav.phtml" />
        </reference>
    </default>
</layout>

Am I missing a step? Why isn't this showing up?


texts: Magento 2 - Check in mini cart if product is virtual

texts:
How can we check in the mini cart if the product is virtual using knockout?
Inside the cart and checkout we can use the following, but that is not working in the mini cart. Any idea?
<!-- ko if: (quoteIsVirtual) -->
<!-- /ko -->


texts: Magento2 : limit concurrent logins for the same customer account

texts:
I want to limit concurrent logins for the same customer account. If customer already logged in one device and also try to login from another device then customer should be logout from previous session. Similar the Admin login sharing feature in magento2.

I want to implement this feature for customer session as well.


texts: Please let me know the Areas where we can apply the concept "Mixin" in Magento 2

texts:
Recently I came across a strange word "Mixin". Got to know that it is something related to "has-a-relationship" in OOPS. A class can be utilized without inheriting it but by having its object in another class. This is very clear. Coming to Magento 2, I have seen many articles which are relating this term to javascript, CSS Less etc.

I am curious to know the application of "mixins" in Magento 2. I can understand that as it is related to OOPs it can apply everywhere but what is the situation or a real time scenario where this will be more helpful and meaningful?


texts: Magento 2 Attempt to load value of nonexistent EAV attribute

texts:
I see in my log the nexe warning:

[2017-05-05 12:23:53] main.WARNING: Attempt to load value of nonexistent EAV attribute '339'
                        for entity type 'Magento\Catalog\Api\Data\ProductInterface'. [] []

I can't find why, but i find this and i don't know if this is true.

Do you know why this problem occurs?


texts: Category static blocks in Magento 2 sample data Luma theme

texts:
I can't figure out how Magento 2 is assigning blocks to categories in the sample data. I see the blocks under CMS, and I see the assignment for a category to only use static blocks, but where are we actually specifying the blocks to use?

Am I missing something obvious here?

Thanks.


texts:
Recently, my Magento site was moved to a new server and the developer messed up big style. I am trying to fix and found a major field missing.
V1.9.2.0
In the customer account information section, there was a field named - Is Activated (I think), where you make customers active or not.
This field is missing and now no new customers can be activated.
I have a few custom mods that were installed but to my knowledge, these don't affect this as it worked perfectly normal previously.

Any ideas how to fix this?


texts: Short Description and long description are not responsive on product page of Magento 2

texts:
I am currently facing an issue with the responsiveness of Magento 2 product page. My descriptions are passing the browser screen toward the right side. They are showing up like this in the attached image. Please take a look and let me know if anyone can help me with this issue.

Thank you.


texts:
I have been looking for a way to disable a Magento module in a Magento Cloud Enterprise instance.

Whenever I run the bin/magento module:disable command, I get this error.

Command line user does not have read and write permissions on generated directory.

So how can I disable modules?


texts: How to add AND OR AND conditions in a product collection?

texts:
ORIGINAL POST Comment ajouter des conditions ET OU ET dans une collection de produits?
comment pourrais filtrer une collection de produit par:
(attribut A : condition A And attribut A : condition B) OR (attribut B : condition C And attribut B : condition D)

TRANSLATION how can I filter a product collection by  (attribut A : condition A And attribut A : condition B) OR (attribut B : condition C And attribut B : condition D)


texts: Customer password not working after migration from Magento 1 to Magento 2

texts:
I have migrated only customers from Magento 1.6.2.0 to Magento 2.2.3 and customers migrated successfully and listed properly in the admin section.

But when I try to login with the Magento 1 password I am not able to login.

So as I check in database the old passwords are stored differently than the Magento 2 passwords.

Here's a screenshot of the database table "customer_entity":

Basically I have found that when customer created from Magento 2 frontend there is a larger string after the first colon : and migrated passwords have only two character after the colon :.


texts: Magento Category Products suck on "Reindex Required"

texts:
After a clean Magento 1.9 install/deployment using Microsoft Azure web app from gallery, the Category Products is stuck on Reindex required

Clicking the reindex button, I just get the error

  There was a problem with reindexing process.

No products or data has been added.

How do I solve this?


texts: Magento ver. 1.9.0.1 System Backup Error

texts:
I was using Magento's default backup function when all of a sudden, all pages went 404.

After digging out more information on this error, it was actually caused by permission error. I changed some of the permissions and ran a code(refer to reference post) and got it running again.

While this has been an ongoing error all along, is there an easier/faster way to execute system backup?

Currently, I am using phpmyadmin and cPanel as manual backup.

Reference:
Attempted Magento Backup - now throws 500 Internal server error page


texts:
I find that the users of our Magento backend/back office waste a lot of time having to resubmit data just because of trailing spaces when trying to filter Magento grids.

Consider the following example:

You'll see that there is a trailing space after "test", namely "test ".
If the user presses enter, no results are returned because there's no match.

I'd like Magento to automatically trim this submission so that it get's rid of preceding & trailing spaces.

Update: Thanks to oleksii.svarychevskyi's answer:

I applied a local override:

app/code/core/local/Mage/Adminhtml/Block/Widget/Grid.php, the method now reads as follows:

protected function _setFilterValues($data)
{
    foreach ($this->getColumns() as $columnId => $column) {
        if (isset($data[$columnId])
            && (!empty($data[$columnId]) || strlen($data[$columnId]) > 0)
            && $column->getFilter()
        ) {
            if (is_array($data[$columnId])){
                $new_values = array();
                foreach ($data[$columnId] as $key => $value){
                    $new_values[$key] = trim($value);
                }
                $column->getFilter()->setValue($new_values);
            }
            else{
                $column->getFilter()->setValue(trim($data[$columnId]));
            }
            $this->_addColumnFilterToCollection($column);
        }
    }
    return $this;
}

The is_array() section handles data submission where the filter consists of up to two values (i.e Date, qty, price etc.)


texts: Magento 2.2 Not Loading theme and blocks

texts:
I have created a magento 2.2 application using composer. Everything working fine with Luma Theme.
Next Step I need to extend the template.

  app / design / frontend /< Vendor name> / < Theme Name> /

Here I have created etc/view.xml, media folder, web folder, registration.php, theme.xml.

Then Created a Magento_theme folder and copied all files from

  vendor / magento / module-theme / view / frontend/

to the folder just created and edited theme.xml , registration.php
and cleared cache and also applied php bin/magento setup:static-content:deploy -f

Then I login to backend I have seen the newly created theme in backend and applied the theme. Then I Changed Logo through Backend. Everything works fine.

But I need to edit header.phtml and I have edited the header.phtml in

  app / design / frontend/< Vendor name>/ < Theme Name > / Magento_theme / templates / html

It doesn't make any change in frontend. I have cleared cache, setup-upgrade everything as devdocs in magento. But No Changes. At the same time I just tried to edit the header.phtml in

  vendor / magento / module-theme / view / frontend / templates / html /

Its working and page changes. I Have Googled a lot and Tried Everything. But I didn't know what is wrong.

The steps I have done is
Create Custom theme in Magento 2


texts: Category search logic (AND instead of OR)

texts: The default search functionality in Magento doesn't seem to offer the 'AND' operator when searching by multiple categories. Hence drilling down a search result by one category and then another doesn't give the desired results. I've figured this is something at the core of the Magento and not an configurable option but don't know where to look to try and alter the operator for this.


texts: How to get configurable attributes in Magento 2?

texts: I know how to get the attributes from the configurable product. I need to know how to get the configurable attributes options label and values without using the product Id so that i can create a configurable product programmatically myself using those attributes.


texts: Possible of error : Magento 2.0.4 to 2.1.0 Upgrade Check Component Dependency Error

texts: From magento 2.0.4 to 2.1.0 Component Dependency Error, how can i solve below error,


texts:
I use the following code to load a block in controller

$this->loadLayout();
      if ($this->getLayout()->getBlock('checkout.cart1')) {
        $cartlink =  $this->getLayout()->getBlock('checkout.cart1')->toHtml();
      }

Here the checkout.cart1 is block name.
My layout file code is

<quickbuy_index_index>
<reference name="content">
<block type="checkout/cart" name="checkout.cart1">
<action method="setCartTemplate"><value>checkout/cart1.phtml</value></action>
<action method="setEmptyTemplate"><value>checkout/cart/noItems.phtml</value></action>
          .
          .
          .
</block>
</reference>
</quickbuy_index_index>

Here my tag is <quickbuy_index_index>
Now the controller code not load my block .
But When i put the layout code within <default> tag instead of <quickbuy_index_index> tag, the controller load the block. like this

<default>
<block type="checkout/cart" name="checkout.cart1">
<action method="setCartTemplate"><value>checkout/cart1.phtml</value></action>
<action method="setEmptyTemplate"><value>checkout/cart/noItems.phtml</value></action>
          .
          .
          .
</block>
</default>

  6.  How i load the block in controller from <quickbuy_index_index> tag.

My problem is, When i put a block in <default> tag, the controller load it.
when i put a same block in url tag (<quickbuy_index_index>) the controller not load it.


texts: Error 404 while creating simple new controller file in magento module

texts:
I have running project. and I have just added new controller file but whenever I am trying to call that from my URL its showing 404 error when I am writing another controller name its showing correctly. I am not getting where is problem

config.xml

<frontend>
  <routers>
     <CustomerMobile>
        <use>standard</use>
        <args>
           <module>Customer_CustomerMobile</module>
           <frontName>CustomerMobile</frontName>
        </args>
     </CustomerMobile>
  </routers>

Controller file ProductreviewController.php

class Customer_CustomerMobile_ProductreviewController extends

Customer_CustomerMobile_Controller_Action
{
    public function indexAction()
    {
        echo $this->__("working test");
    }
}

url i am trying is http:/localhost/CustomerMobile/Productreview


texts: installing an extension from magento 1.7 to magento 1.8

texts:
I am trying to install order_delivery_date-0.1.5 extension on magento 1.8.
The extension was compatible with magento 1.7.
now in magento 1.8 every thing seems to be ok, but the database part.
the delivery date section can be seen in front end and back-end. but the extension didn't make any change on the database. as you can see the mysql4-install-0.1.0.php below, should add a new table to the database and 4 new attribute to existing tables:

<?php
$installer = $this;

$installer->startSetup();

$installer->run("

-- DROP TABLE IF EXISTS {$this->getTable('deliverydate')};
CREATE TABLE {$this->getTable('deliverydate')} (
  `deliverydate_id` int(11) unsigned NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `filename` varchar(255) NOT NULL default '',
  `content` text NOT NULL default '',
  `status` smallint(6) NOT NULL default '0',
  `created_time` datetime NULL,
  `update_time` datetime NULL,
  PRIMARY KEY (`deliverydate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    ");

$this->_conn->addColumn($this->getTable('sales_flat_quote'), 'shipping_arrival_date', 'datetime');
$this->_conn->addColumn($this->getTable('sales_flat_quote'), 'shipping_arrival_comments', 'text');
$this->_conn->addColumn($this->getTable('sales_flat_order'), 'shipping_arrival_date', 'datetime');
$this->_conn->addColumn($this->getTable('sales_flat_order'), 'shipping_arrival_comments', 'text');

$installer->endSetup();

so, i am wondering that, what is the problem? why the mysql4-install-0.1.0.php does not do any change on the database? how can i do this changes manually?


texts: Magento 2.3 - Moving the payment option in the checkout to the first step

texts:
Is there an easy way to move the payment options out of the second step (Payment and Review) and into the first step (Shipping Address)? I have searched far and wide and there is almost zero documentation on this particular issue, most people would suggest to use a one step checkout and I agree, but the for whatever reason the numbskull in charge is adamant on moving the payment after the shipping address on the same step.
Please advice


texts: In Magento 2, is there a concrete example of something that's built using the Service Contract concept?  I've seen this term thrown around a lot, but looking at Magento 2 as it exists now it's not clear to me if Service Contracts are more guiding principles, or if they actually tie back to specific implementations of things in Magento 2.


texts: paypal payment showing processing/pending review after paying in paypal in checkout magento

texts:
I am usign magento 1.7.2.0 .
I haven't edited any core files in magento and set up checkout via paypal.
after checkout it redirects to paypal and paynow option is there.
after clicking on paynow it doesn't redirect to site back.It gives back link.
And payment status shown is Payment Review or Processing.
Why it's not showing status completed?
Why payment is not successful? any idea?please help

I have set auto return in paypal account and set url of my site in site preference and also ipn return url of site in my paypal profile.


texts: set default page to Particular store view

texts:
I have to store view under a store whose code as default and crescent

when I run the domain name it should be pointing to default store and when I run URL as http://hostname/crescent it should pointing to crescent store

for example

http://localhost:81/ecommerce/ Should point to http://localhost:81/ecommerce/?___store=default

http://localhost:81/ecommerce/crescent Should point to http://localhost:81/ecommerce/?___store=crescent

To achieve this, I tried below

Under URL rewrite management I created a custom rule as below

Request Path: /

Target Path: ?___store=default

Redirect: Permanent

But no luck,

can someone suggest me on this.


texts: Sidebar add different static blocks for different category roots

texts:
I have a small problem and try to solve them. I search for a while now for a solution but can't find something that match my problem.

My case is that i have different root categories with different topics. So the final result should be that i can insert different static blocks in my sidebar for different topics that depends on that topic.

For example if you are in the section for electronics then you get on the right site a banner with the number from that department which can help you directly.

That is only one example there you should more boxes that are different. So does anybody know if there is an extension to solve that problem? Or is there a native solution to solve that problem?

The best way would be that i can select a root category on static blocks or something else.


texts: Setting website config to blank, Magento uses default

texts:
Magento doesn't seem to like me setting blank config values at website or store level.

Steps to reproduce (1.6.2.0, 1.7.0.1, 1.7.0.2)

1) change config scope to website
2) untick use default next to 'default welcome message'
3) clear the text in the field
4) save

At this stage Magento will re-tick the use default box, however, it has saved my blank value. The next time I save this config page the config value from the default level is used.

This functionality was not present in 1.4, and I don't have 1.5 to test.

My question is, how do I create blank config values at the website or store level?

Update

In version 1.7.02 the code looks like this:

            $path = (string)$element->config_path;
            if (empty($path)) {
                $path = $section->getName() . '/' . $group->getName() . '/' . $fieldPrefix . $element->getName();
            } elseif (strrpos($path, '/') > 0) {
                // Extend config data with new section group
                $groupPath = substr($path, 0, strrpos($path, '/'));
                if (!isset($configDataAdditionalGroups[$groupPath])) {
                    $this->_configData = $this->_configDataObject->extendConfig(
                        $groupPath,
                        false,
                        $this->_configData
                    );
                    $configDataAdditionalGroups[$groupPath] = true;
                }
            }

And it uses empty() to evaluate the string.

Does anyone have a suggestion to modify this code to allow empty strings that I specify to override the default?


texts:
Hi could any one tell

  methods used in in layout file and its functionality in magento

for example

<action method=”insert”>
<action method=”setImgSrc”>

can any one list defalut methods used in layout file.


texts:
I am looking for a free event(like exhibitions) manager extension that can list events in a list instead of a full calendar.
I need to be able to output like:

2013 events
August 10th
This is a new event
August 12th
This is a new event

2014 events
August 10th
This is a new event
August 12th
This is a new event

Any suggestions? :)


texts:
I can't use n98 magerun to create a dump of my database, I get mysqldump: Got error: 1045: "Access denied for user 'example'@'example.de' (using password: YES)" when trying to connect after executing ./n98-magerun.phar db:dump

But the credentials in app/etc/local.xml are obviously correct, otherwise the shop wouldn't work. Is it possible that the password is too complex or the special chars like !%$§ are causing problems?


texts: How do I get customer info on successpage for third party service

texts:
I have a third party service that needs customer info to manage advertisement.
I have this code for the successpage of Magento:

<script type="text/javascript"> window.sovIframes = window.sovIframes || []; window.sovIframes.push({

trafficSourceNumber : '3637',
trafficMediumNumber : '2',
sessionId : 'Session-ID',
timestamp : 'Timestamp',
orderId : 'Order-ID',
orderValue : 'Bestelwaarde',
orderCurrency : 'Bestelvaluta',
usedCouponCode : 'Gebruikte kortingscode',
iframeContainerId : 'sovendus-container-1' });

The values between the brackets must be the values of Magento.
How do I get these values? Are they loaded on the successpage automatically?


texts:
I've been a while seeing as I can do the following, currently in my product page when any amount is selected and customized options dynamically calculates my total price up there perfect, but I need, give me the price of one unit also with the same options to know the cost of a unit:

example: product 100 + custom options = 135 € (100und) 1.35 € (1 Unit) .

How can I get this?

Thank you


texts: How to add custom stylesheets to magento2 Wysiwyg editor

texts: How do i add styles to the admin so that when i enter content into the wysiwyg and save i can see a preview of what it will look like on the fronted in the wysiwyg


texts: Magento 2: Change the bestseller report count more than 5 items

texts:
How to change the bestseller report items number more than 5 items Magento 2?

Thank In Advance..!


texts: How to get all Products including disabled in Magento 1.3

texts:
I have spent hours trying to find how to get a simple thing like all products - including the disabled ones.

My apologies , this is such an old version! I have looked up most of the posts on stack exchange etc to do this.  the closest I have got is This post

In my code below , $products and $allProducts give me exactly the same amount , leaving out 200+ disabled products.

This is Magento 1.3
I do have flat catalog product & category switched on , and I want to run this script fairly regularly and don't want to have to switch it off.
I have read several other stack overflow etc. posts that don't work either.

Any Ideas how I can get all products in Magento 1.3 including the disabled ones?

<?php

header('Content-Type: application/json');
error_reporting(E_ALL);
ini_set("display_errors", 1);

require_once('./app/Mage.php');
Mage::app();

$storeId = Mage::app()->getStore()->getId();

$products = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToSort('created_at', 'DESC')
    ->load();

$allProducts = Mage::getResourceModel('catalog/product_collection');

echo $products->getSize();
echo $allProducts->getSize();

?>


texts:
I'm struggling with an error that is thrown in the debug.log. The problem is that multiple indexers are not updated allthough the cronjobs are running.
Re-indexing by CLI is working properly on all indexers but that cannot be the solution.
The debug.log
[2020-09-17 05:25:12] main.ERROR: Cron Job indexer_reindex_all_invalid has an error: URI is not valid and cannot be converted into a string. Statistics: {"sum":0,"count":1,"realmem":0,"emalloc":0,"realmem_start":146800640,"emalloc_start":143814352} [] []
[2020-09-17 05:25:12] main.CRITICAL: URI is not valid and cannot be converted into a string {"exception":"[object] (Laminas\\Uri\\Exception\\InvalidUriException(code: 0): URI is not valid and cannot be converted into a string at /PATH/web/vendor/laminas/laminas-uri/src/Uri.php:363)"} []

I took a look at the specified line but it's just the function that throws the exception. How can i find the 'url' that is causing the problem?
Config:

Magento 2.3.5.-p1
PHP 7.3-Stable

Thanks


texts: How to get a Field of type “image” not to have a delete checkbox?

texts:
How to get a Field of type "image" not to have a delete checkbox ? As it's a required attribute for my form, I don't need the delete checkbox.

Here is my addField example :

$fieldset->addField('filename', 'image', array(
                                'label'     => Mage::helper('example')->__('Example image'),
                                'required'  => true,
                                'name'      => 'filename',
                    ));


texts: How to optimize a php code for magento product info collection by product id to load fast

texts: I am creating an API file for android to get product info by requesting with a product id in how to fast the loading process of that page


texts: Magento 2: Delete magento product attributes?

texts:
How do you delete created product attributes in Magento 2?

I can't get rid of it. I have couple of Magento product attributes which not needed


texts:
This is my model Class

<?php

class Magentotutorial_Weblog_Model_Blogpost extends Mage_Core_Model_Abstract
{
protected function _construct()
{
    $this->_init('weblog/blogpost');
}
}
?>

My question is What does this code do in magento?

$this->_init('weblog/blogpost');


texts: Magento 1 | Email Template | Get Default Store name instead of current

texts:
We need to show default store name in email footer instead of current store name already used in footer template:

Thank you, {{var store.getFrontendName()}}!

file: app/locale/en_US/template/email/html/footer.html


texts:
I took over this webshop. They made a store switcher themselves. You can see the select list in action in the header. I want to add the default store switcher from /app/design/frontend/default/trendy-green/template/page/switch/stores.phtml.

Its listed in /app/design/frontend/default/trendy-green/layout/page.xml like:

    <block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
        <label>Page Footer</label>
        <action method="setElementClass"><value>bottom-container</value></action>
    </block>
    <block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
    <block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
</block>

I already tried to load the default theme but no result...

Why the default store switcher isn't showing up?


texts:
I want to modify the code of Magento\Sales\Model\Service\PaymentFailuresService.php.

So I'm overriding Model file using the below code but it's not working.

etc/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">
    <preference for="Magento\Sales\Model\Service\PaymentFailuresService" type="Vendor\Module\Model\Service\PaymentFailuresService" />
</config>

Vendor\Module\Model\Service\PaymentFailuresService.php

<?php
namespace Vendor\Module\Model\Service;

class PaymentFailuresService extends \Magento\Sales\Model\Service\PaymentFailuresService
{
    private function getTemplateVars(Quote $quote, string $message, string $checkoutType): array
{
    return [
        'reason' => $message,
        'checkoutType' => $checkoutType,
        'dateAndTime' => $this->getLocaleDate(),
        'customer' => $this->getCustomerName($quote),
        'customerEmail' => $quote->getBillingAddress()->getEmail(),
        'billingAddress' => $quote->getBillingAddress(),
        'shippingAddress' => $quote->getShippingAddress(),
        'shippingMethod' => $this->getConfigValue(
            'carriers/' . $this->getShippingMethod($quote) . '/title',
            $quote
        ),
        'paymentMethod' => $this->getConfigValue(
            'payment/' . $this->getPaymentMethod($quote) . '/title',
            $quote
        ),
        'ccType' => 'Test',
        'items' => implode('<br />', $this->getQuoteItems($quote)),
        'total' => $quote->getCurrency()->getStoreCurrencyCode() . ' ' . $quote->getGrandTotal(),
    ];
    }
}

module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Module" setup_version="1.0.0">
        <sequence>
           <module name="Magento_Sales"/>
        </sequence>
    </module>
</config>

Please help me with this.


texts: Magento 1.7x version- Last day of support?

texts:
What is the last day we can use Magento 1.7 while still receive support from Magento developers?
I heard its 2-3 years after Magento 2.0 release but no specific date has been published.
Any ideas when it would be the smart time to upgrade from 1.7 to 2.x?


texts: How can I integrate Magento into an existing website via Cpanel and show the base URL?

texts:
I installed Magento but now all magento things are located at /magento/. I don't want "magento" to be in the URL, and I need to be able to integrate Magento with my existing PHP-based website (no frameworks like wordpress - my website is purely PHP).

For example, I need to have an "add to cart" button on my website and have it add to cart even though I am on MY WEBSITE not within the magento subdirectory; and also to be able to display my cart in a sidebar section ON MY WEBSITE which is below the /magento/ subfolder (my website is in the root).

Further, do I need HTTPS?


texts: "buy_now_url" doesn't work on magento 1.8 [SOLVED]

texts:
I have a strange problem on Magento 1.8 using the REST API.
When I do this request

GET http://magentohost/api/rest/products/8

I can retrieve a "buy_now_url" attribute, like this:

<buy_now_url>http://magento/index.php/checkout/cart/add/uenc/aHR0cDovLzEyNy4wLjAuMS9Tb3VyY2VzL2FwaS9yZXN0L3Byb2R1Y3RzLzE,/product/1/</buy_now_url>

In Magento 1.7 using this URL I can directly add a product in the cart, in Magento 1.8 it doesn't work, I always obtain an empty cart. I used a simple product.

Any idea?


texts:
I have been working in the recovery of a hacked Magento 1.9 installation,
this site was destroyed and I managed to recover the database and make it work again with an updated version of the template/theme that was used originally (Milano).

There is a page, "store locator" that uses a external JS file that is called scriptstorelocator.js

This file was part of the old hacked filesystem, Which I have a backup, I copied the file to the same folder where it used to be to the new installation, but does not work. Somehow seems that the
JS file is not loaded.

Not sure I have placed the file in the wrong folder:

I have stored it public_html/skin/frontend/default/milano/js/

or Im doing something wrong in the page settings?

I have tried to paste the JS inside the HTML editor (very naive) and it didnt work, is there a way to bypass this?

Thanks guys

I attach this images that show the settings:

UPDATE

Finally I managed to insert the JS file in the header using

       <![CDATA[<script type="text/javascript" src="http://www.example.com/js/scriptstorelocator.js"></script><script type="text/javascript"></script>]]>

thanks for your help


texts:
I want to show messages using Alertify JS.
I included alertify.min.js and alertify.css. But it is not working.

Please anybody can navigate that how can i use Alertify JS in Magento 1.9.
Or have any module for it.

Thank you


texts:
I wanted to override the content of addtocart.phtml which is located in

  vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml

Now I want to modify the content of this and add this to my custom module located in

  app/code/CustomVendor/CustomModule/view/frontend/templates/product/view/addtocart.phtml

But my changes does not appear. Is my path wrong? What or where should I place the custom addtocart.phtml file?


texts:
I am developing a Magento extension.
My extension optimizes all sever files.
But if I leave this page that is executing this, in other words when I click something else in the menu, the processing is stopped.

So I have to repeat it manually.
I guess to do it I need multi task processing or thread processing.

I want to continue this process though I click another page such as manage product option.

Is it possible?  Must I use cron?

So I am trying to do just bellow.

protected function optimizeAllAction() {

ignore_user_abort(true);  //I apply here

$steps = 2;
$this->blockImages = $this->getLayout()->createBlock('imagerecycle/images');
$images = $this->blockImages->_getLocalImages();
include_once(__DIR__.'/../Helper/Data.php');
$helper = new Imagerecycle_Imagerecycle_Helper_Data();

foreach ($images as $image) {
    if ($image['optimized'] === false) {
        if ($steps === 0) {
            $this->ajaxReponse(true, array('continue' => true, 'totalImages' => $this->blockImages->getTotalImages(), 'totalOptimizedImages' => $this->blockImages->getTotalOptimizedImages()));
        }

        $returned = $helper->optimize($image['filename']);
        if ($returned === false) {
            $this->ajaxReponse(false);
        }
        $steps--;
    }
}
}

is it right?


texts: I need to send email with PDF attachment when the order payment is done or when the order status is changed to complete..however i can't find any event related to completion of order ...mails are being sent for order placing or shipment etc but not on order complete...Any help will be appreciated.


texts: Backdate Orders? Change date on manual orders

texts:
When creating an order, is there anyway to select the date when the order was made.

As some orders taken offline, we want to add back into the sytem, with the correct date, so they show on the reports.


texts: Magento 2 - InstallData.php does not run again after first time

texts:
I have created my custom module to add more attributes for customers.

The InstallData.php worked perfectly for the first time and added all the attributes I wanted.

However, I need to add more attributes. I updated my InstallData.php and run php bin/magento setup:upgrade, but the new attributes are not added.

What did I miss in this problem?


texts: Show custom customer address attribute in customer address edit

texts:
I have created my custom address attribute through my own module, it is shown on checkout page and admin, I also managed to insert it to customer address edit in account by overriding edit.phtml. Unfortunately, I struggle with adding value to the input so the current value is shown in the input. I found some solutions but they only work with customer attribute but not with the customer address attribute.
edit.phtml  -this is my current code, it does not work, value is still empty
<?php

  $DIC = '';
    if($block->getCustomer()->getCustomAttribute('DIC')) {
      $DIC = $block->getCustomer()->getCustomAttribute('DIC')->getValue();
    }
?>

               DIČ

               <input type="text" value="<?= $DIC ?>" title="<?php /* @escapeNotVerified */ echo __('DIC') ?>" name="DIC"/>

My Magento version is 2.2.11 CE.


texts: How to check if customer has JUST logged in or out?

texts:
I need to know if the customer has successfully logged in or logged out in the current request.
I need to do it in a After plugin (after execute of LogIn and Logout from customer)
How can I check it?
Is there something in request I could get and compare with data in login's logout's afterExecute?
I though about formkey, but I'm not 100% sure it changes when user toggle between login and logout.
Update (Clarifying the question):
I'm developing a module for login and logout using AJAX but I don't want to reload the page in any moment, this is why I need to add a extra piece of HTML, this HTML is the header links (that first menu in Luma theme, with Register and login when are not logged, and account, address, wishlist etc when logged). Once the menu changes when toggled between login and logout I need to update it (in my case replace the whole menu).
So I created a after plugin used for both actions in customer module: Login and Logout, once they do the same thing I use same plugin for both action (but it doesn't matter).
The login may fail so I don't need to updated the menu, then I don't want to send HTML attached to answer unnecessarily, this is why I need to know if the customer was logged out and now logged in and vice-versa.