texts: Specific categories products not loading in magento

texts:
I am loading specific category products on a page, but it's not working properly, it's getting all the products that added.. not specificaly a category products..

Please help:

code i am using is :

$category2 = Mage::getModel('catalog/category')->load(10);
    //$products->addCategoryFilter($category);
    $products2 = Mage::getModel('catalog/product')->getCollection();
  $products2->addAttributeToSelect(array('name', 'thumbnail', 'price')); //feel free to add any other attribues you need.
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products2);
  Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products2);
  $products2->getSelect()->order('RAND()');
  $products2->getSelect()->limit(3);


texts: I just want to understand something. Our developer, busy with cleaning up malware from our site, asked for SSH access in order to install latest security patches on our magento 1.9.2.4. The hosting won't allow it for security reasons? ok, now I have to know for sure if those patches can be easily installed only by a FTP access or if it is necessary in order to finish the job and secure the site to have SSH. In that case I'll have to move to a different hosting. Developer is not helping a lot in this. Please help as the developer won't finish his job and I'm stuck in my ignorance of the topic and our site down the developer want to be paid for unfinished work carried out and I don't know if he's taking me for a ride or what. Thanks


texts: Magento2: Impossible add discount code in checkout

texts:
We have any issue with approve discount code in checkout. In cart work correct and is possible add discount code.

I describe issue on movie below:
https://streamable.com/dq8io

Anyone know how to solve it or if no any solution any help how to disable discount form from checkout?


texts:
I am trying to display a message for the user once they begin checking out a product past a certain time (10AM).

How would I go about doing this? Is this even possible? I'm just not sure how to catch the time from the user.


texts: setup upgrade in integration after deployment(Magento2 cloud)

texts:
When does command setup:upgrade run after the code is deployed to production environment
Is there any option to enable this configuration, and schedule when to run this command or it will run automatically when my code is deployed


texts: Change order of configuration options in customer product view

texts:
I have configurable products with many attributes like size and color in v2.2.7.
They are listed in the admin area and in Stores > Attributes > Attribute Set > Default.
The order currently is "Size", then "Color".

But on the customers view for the product, attributes are listed as "Color" and then "Size".

This post in the magento forums outlines how to do it while creating a configurable product. However, if products are already created and you go to configuration options, there is not a way to edit attributes order without also recreating all configured products.

Making the change suggested in "Stores > Attributes > Product > Storefront Properties" from this post, changes the order of how things show up in layered navigation. But it doesn't change the order of configuration options the customer sees.

I'm trying to make "Size" appear above "Color" when customer is looking at product page. How do I change the order of configuration options for products already created?

UPDATE

The order attributes show up in customer view / layered navigation is changed from Stores > Attributes > Product > [attribute] > Storefront Properties > [Position].
The order configuration options show up in customer view / product
details page are controlled by position column in the
catalog_product_super_attribute table (see accepted answer).
The order attributes show up in admin section when adding new
products is based on the order in Stores > Attributes > Attribute
Set > [set] > [Groups]. Note that custom attributes added to the "Product Details" group don't always follow the order in v2.2.7. So it's best to click "Add New" under Groups and add the custom attributes you need to show up in a set order during product on-boarding to the group you created.


texts:
Admin Category Product count shows wrong value when Is Anchor is yes.

Please help.


texts: Magento 2 - How to get dynamic checkout fields from db in a new step?

texts:
I added an admin side interface to add some questions that the admin need to ask to customer while checkout. These questions saved in a custom table.
I wanted to add a new step in checkout, and shows the questions saved by admin in a from, with an input field for each . and need to save those in Db.
How to do it?


texts: magento 2.3: category loses "use default value" only on default store view and there are no store related rows in tables

texts:
I have a magento 2.3 with 4 websites, each website has one store view.
When I save a category via backend everything works as expected, but when I save a category via code, the default store view gets the "use default value" checkbox unchecked. This happens ONLY on the default store view (the other store views keep their checkboxes checked).
I've looked directly in the database and here all my rows have store_id = 0, meaning that there are no store-specific rows.
This is the code I've tried so far:
// via interface
/* Magento\Catalog\Api\CategoryRepositoryInterface; */
$category = $this->categoryRepositoryInterface->get($categoryId);
$this->categoryRepositoryInterface->save($category);

// via model (deprecated)
/* Magento\Catalog\Model\Category; */
$category = $this->categoryModel->load($categoryId);
$category->save();

// via factory
/* Magento\Catalog\Model\CategoryFactory; */
$category = $this->categoryFactory->create()->load($categoryId);
$category->save();

I also tried to explicitly set the admin store id when I call the category:
$category = $this->categoryRepositoryInterface->get($categoryId, 0);
$this->categoryRepositoryInterface->save($category);

but still the "use default value" option gets unchecked on the default store only.
How can I save the categories so that the checkboxes stays checked even in the default store view? Thanks
Edit to add:
I also tried this code:
$category = $this->categoryRepositoryInterface->get($categoryId, $myDefaultStoreId);
$category->setStoreId($myDefaultStoreId);
$category->setData($defaultAttribute, null);
$this->categoryRepositoryInterface->save($category);

This  works: if I save via code and then check via backend, I can see that the "use default value" checkbox for that particular attribute has been kept. Unfortunately I don't know which attributes have the checkbox option so I  cannot use this method. More over, this method requires to save the category twice (once for all the store views and a second time for the default store view) so it's not a good solution.
I also tried to manually set the checkboxes:
$category = $this->categoryRepositoryInterface->get($categoryId, $myDefaultStoreId);
$category->setStoreId($myDefaultStoreId);
$categoryData = $category->getData();
$categoryData["use_default"] = $defaultValues;
$this->categoryRepositoryInterface->save($category);

This also works but it has all the problem of the previous solution so I cannot really  use it.


texts: Magento data migration 1.9 to 2.3 Integrity Check failed error

texts:
After successfully completed migrate:settings,

  php bin/magento migrate:settings --reset
  vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.2.3/config.xml

getting error while running migrate:data,

  php bin/magento migrate:data --reset
  vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.2.3/config.xml

How to solve the error?


texts:
I created 2 blank page that have these address (Note that are different domains):

www.mysite.com/cars.phtml (store_view_code = en)
www.mysite.it/auto.phtml (store_view_code = it)

From cars.pthml page I would switching to auto.phtml page.

I tried to do this:

    $params = array(
       '_current' => TRUE,
       '_use_rewrite' => TRUE,
       '_store_to_url' => TRUE,
       '_store' => it
       );
    $url = Mage::getUrl('', $params);
    Mage::app()->getResponse()->setRedirect($url);

But redirection works partially because it redirect from 'www.mysite.com/cars.phtml' to 'www.mysite.it/cars.phtml' and generated obviously a 404 error.

To completeness this is how I set my .htaccess to handle store view redirection:

    #######################################################
    SetEnvIf Host www\.mysite\.com MAGE_RUN_CODE=en
    SetEnvIf Host ^mysite\.com MAGE_RUN_CODE=en

    SetEnvIf Host www\.mysite\.it MAGE_RUN_CODE=it
    SetEnvIf Host ^mysite\.it MAGE_RUN_CODE=it


texts: What is the best method to delete sub stores from Magento?

texts:
So we have a Magento setup with 1 main store and 48 sub stores. For a multitude of reasons we now want to reverse a lot of work quickly and essentially delete these 48 sub stores systematically. We want to delete all of the websites, store names and website views.

I realise that you can delete each sub store simply from the admin area on below page:

System > Manage Stores

Then select the website, store name or website view you want to delete.

Click delete and hey presto it's gone.

BUT we want to preserve the sales data and customer data.

Is this feasible or a distant pipe dream? If we have to delete the sales data and then re-upload it manually to our main store we can do this, but trying to avoid the manual admin as it will be 10-20 hours work to add the 500+ sub store orders back in to our main store. Any input or ideas would be greatly welcomed. Thanks.


texts: Configurable product option values in database

texts: Where are configurable product option values, stored in the database?


texts: Magento 2 - Redirect to Account Dashboard During Checkout Funnel Login

texts:
I have the setting checked to redirect a customer to their account dashboard after logging in and it works fine on regular pages, but I noticed that it has no effect when someone is on the checkout page and they log in during the checkout processes.

I need to redirect the customer to their dashboard when they are attempting to log in on the shopping cart page during the /checkout/cart/ funnel. Right now, it shows them their shipping options after logging in from the cart and allows them to continue the checkout process. Any solutions?


texts:
I can not call helper:
My helper file: class Test_Productvideo_Helper_Video extends Mage_Core_Helper_Abstract

Call helper on methode in controller file:
$video = Mage::helper('productvideo/video')->getVideoByUrl($url);
But $video return null.
Help me fix it!


texts:
I have just installed magento but I realise the installation was done on the wrong server (mistake from my client). So I need to clear out the entire installation from the current place.

I have tried this from SSH:

php bin/magento setup:uninstall

But it does not work.

And Is it right to delete all the magento files from the installation folder manually and also drop database?

I would be pleased to get help uninstalling this.

Thanks


texts: What event listener is used to validate checkout fields

texts:
I can see that the input fields are validated on keyup.

I want to simulate keyup on a field when clicking a button, so that the field gets validated.

I tried doing it with JQ:

var e = jQuery.Event("keypress");
            e.which = 13;
            e.keyCode = 13;
            $('input[name="street[0]"]').trigger(e)

But no luck, which probably means that Magento 2 is not listening for JQ events.

How do I make Magento think I typed in a field? (Or just validate a field, if there's a way to do it better)


texts: Magento 2.4 upgrade Class 'Zend_Controller_Request_Http' not found

texts: I recently updated from Magento 2.2 to Magento 2.4 and I have some custom modules which are throwing errors like these when I run setup:di:compile in my terminal. I have observed that in vendor folder the zendframework is now changed to zendframework1. However I cannot understand how to find the file and resolve this error. My custom modules extend Zend_Controller_Request_Http. Any help is appreciated. Thank you.


texts: I am experiencing a really weird issue: When I modify a product URL key in backend, redirect from old URL doesn't apply. Valid URL is still the old one, in spite of new one is shown in backend. If i type in my browser the new URL, i get 404 error.


texts: How to remove special price from configurable parent product in magento2

texts: We have migrated Magento 1 to Magento 2 after migration special price of configurable product parent is showing but we can't edit this special price in the backend.


texts: Magento 2.3.1 Composer Fatal error installing anything

texts:
After thing to install a few other extensions, I'm getting the Fatal error message with anything when using Composer.
I have installed a fresh copy of Magento 2.3.1 and I'm trying to install the data migration tool using the instructions on github.com/magento/data-migration-tool
composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool
composer require magento/data-migration-tool:2.3.1
I get
./composer.json has been updated
but then get the following error
Fatal error: Uncaught TypeError: Return value of Magento\InventoryComposerInstaller\Plugin_composer_tmp1::initModuleDeployment() must be an instance of Magento\InventoryComposerInstaller\void, none returned in phar:///opt/cpanel/composer/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code:69
Stack trace:
0 [internal function]: Magento\InventoryComposerInstaller\Plugin_composer_tmp1->initModuleDeployment(Object(Composer\Script\Event))
1 phar:///opt/cpanel/composer/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(176): call_user_func(Array, Object(Composer\Script\Event))
2 phar:///opt/cpanel/composer/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
3 phar:///opt/cpanel/composer/bin/composer/src/Composer/Installer.php(204): Composer\EventDispatcher\EventDispatcher->dispatchScript('pre-update-cmd', true)
4 phar:///opt/cpanel/composer/bin/composer/src/Composer/Command/RequireCommand.php(18 in phar:///opt/cpanel/composer/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code on line 69
Have tried Magneto 2.3.0 & 2.3.1 and both get the same error.
Can someone point me int he right direction to resolve this issue?
Thanks


texts: Magento from Admin to Setup Wizard introduces a 401 page

texts:
When I want to access to Web Setup Wizard from Admin Panel (system / tools / Web Setup Wizard), I obtain this message:

  Magento Setup 401 Unauthorized Access

I have nevertheless all the rights as user administrator!

Any Ideas,


texts: How to hide specific days from admin form calendar field in magento 2

texts:
I want to disable week days (Saturday & Sunday) in admin form calendar field. check below screen-shoot.

Below is my field code.

$fieldsetDirector->addField(
        'attendance', 'date',
        [
        'name' => 'attendance',
        'label' => __('Attendance'),
        'title' => __('Attendance'),
        'date_format' => 'yyyy-MM-dd',
        'id' => 'attendance'
        ]
    )


texts:
I'm new with magento
i created new block for displaying it as a footer on my store.
i want to display a store logo inside the footer
thanks.
I'm using Magento 2.2.5 with Luma theme


texts: Get the lowest and highest possible price for a configurable product

texts:
What would be a good way of retrieving the lowest and highest possible prices for a given configurable product - based on its availble options?

For example a t-shirt comes in the following sizes and prices:

Small - $10
Medium - $20
Large - $30

I want to get an array like so:

array(10, 30)

My best idea so far is load the configurable product type instance and use getUsedProducts, then create an array of prices, sort and slice.

That should work, however this needs to be run on the product list template so it needs to be semi efficient.

Any others out there faced this problem before?

EDIT - that wont work since i want the configurable pricing value i.e. the additive price magento puts on top of the configurable product price


texts: Magento SOAP 500 Internal Error Response

texts:
I'm getting a 500 internal error response when I try to retrieve data via SOAP.

What I have that's working and not giving me 500 internal error:

<?php
$client = new SoapClient('http://example.com/api/v2_soap/?wsdl');
$session = $client->login('xxx', 'xxx');
$complexFilter = array(
    'complex_filter' => array(
        array(
            'key' => 'type',
            'value' => array('key' => 'in', 'value' => 'simple,configurable')
        )
    )
);
$result = $client->catalogProductList($session, $complexFilter);

foreach ($result as $key => $value) {
    $id = $value->product_id;
    echo $id;
   // productPrices($id); <-- this issue causes the error.
}

?>

When I then try to call a funtion in the foreach loop (see comment above):

function productPrices($id){
    $client = new SoapClient('http://example.com/api/soap/?wsdl');
    $session = $client->login('xxx', 'xxx');
    $att = array("visibility","sku","special_price", "price");
    $arguments = array( $id, NULL, $att);
    $resultPrice = $client->call($session, 'catalog_product.info', $arguments);
    echo $resultPrice['visibility'].",".$resultPrice['sku'].",".$resultPrice['special_price'].",".$resultPrice['price'];
}

The response I get from the server is now internal error 500. I have maximum 90 sku's/product ids.

Anyone know what the error might be?


texts: The template can't render images and blocks

texts:
In the frontend, the images URLs and blocks are not rendered. only show strings like this, and I don't know how to modify a template to render that.

  {{media url="wysiwyg/1S-Shine-2.png"}}


texts: Magento 1.9 : Set additional information tab as active

texts: I want to set the tab with product attributes active, instead of description


texts: Magento2 - Full page cache issue with multiple stores

texts:
I have multiple storeviews for my Magento2 website. It is working fine until Full Page cache enabled from Store -> Configuration -> Advanced -> System -> Full Page Cache -> Built-in Cache

The issue is that the storeviews are mixed up when FPC enabled. For example, sometimes my USA website are displaying products from EUR site under some categories (random categories). I need to clear the cache php bin/magento cache:flush to get the products showing correctly again. But the problem will come back again after a while.

How can I fix this?

Update,

This has something to do with a 3rd party GEO IP module I installed. Once I disable the module. Full page caching is working properly again. But I have not figured out how to get GEO IP module working togaher with Full Page Cache yet.


texts: Using Magento 2 Framework for other web application

texts: I wonder if it is possible to use Magento framework for other purpose, like making a blogging website and remove ALL e-commerce features and keep only Admin interface, dependency injection, factory, command line, the frontend stacks, ... If it is possible how can I do it? Is it worth to try?


texts: Trying to pull top product by customer group

texts:
Does Magento have the ability to provide top selling products by customer group ID? I have dug through the default reports and nothing has caught my eye.

I'm not trying my hand at raw SQL queries to no avail.

My solution:

SELECT  items.order_id AS orderid,
    items.item_id AS itemid,
    orders.total_item_count AS total_items_in_order,
    items.product_type,
    items.sku AS itemcode,
    items.created_at AS orderdate,
    base_total_paid,
    count(items.sku) as totalOccurence,
    items.name AS itemname
FROM mg_sales_flat_order AS orders
    JOIN mg_sales_flat_order_item AS items
      ON items.order_id = orders.entity_id
    LEFT JOIN mg_sales_flat_order_address AS address
      ON orders.entity_id = address.parent_id
WHERE ((customer_group_id=7) OR (base_total_paid>=200)) and
     items .created_at > date_sub(now(), interval 4 year)
GROUP BY items.sku
ORDER BY count(items.sku) DESC
LIMIT 20


texts: Add extra column to table in add to cart page

texts:
Need to add extra column to add to cart functionality, How I can do that. Any reference link or anything would be appreciated.

I followed from cartController to Mage_Sales_Model_Quote to check how values are inserting. But I know using setExampleCoumnName() orsetData() I can pass value to custom column. From here How I can go further?

I am trying to call the event to insert value to sales_flat_order_item table,

public function convertymyquotevalueintoordertable($observer)
    {
        $quoteItem = $observer->getEvent()->getItem();
        $orderItem = $observer->getOrderItem();
        if ($quoteItem->getPrintPrice()) {
            $orderItem->setPrintPrice($quoteItem->getPrintPrice());
        }
        return $this;
    }

In config.xml file of sales module,

    <sales_convert_quote_item_to_order_item>
        <observers>
            <mage_sales>
                <type>model</type>
                <class>mage_sales/observer</class>
                <method>convertymyquotevalueintoordertable</method>
            </mage_sales>
        </observers>
    </sales_convert_quote_item_to_order_item>
</events>

Let me the mistakes I did here.


texts: Save or Update custom customer address attribute data

texts:
I created custom attribute for customer address like this:

$customerEntity = $customerSetup->getEavConfig()->getEntityType('customer_address');
            $attributeSetId = $customerEntity->getDefaultAttributeSetId();

            $attributeSet = $this->attributeSetFactory->create();
            $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

            $customerSetup->addAttribute('customer_address', 'subdistrict', [
                'type' => 'varchar',
                'label' => 'District',
                'input' => 'text',
                'required' => false,
                'visible' => true,
                'visible_on_front' => true,
                'user_defined' => false,
                'sort_order' => 83,
                'position' => 83,
                'system' => 0,
            ]);

            $attribute = $customerSetup->getEavConfig()->getAttribute('customer_address', 'subdistrict')
                ->addData([
                    'attribute_set_id' => $attributeSetId,
                    'attribute_group_id' => $attributeGroupId,
                    'used_in_forms' => ['adminhtml_customer_address', 'customer_address_edit', 'customer_register_address','customer_address']
                ]);
            $attribute->save();

i tried to add/update the data using customer address repository interface like this:

public function __construct(
  \Magento\Customer\Api\AddressRepositoryInterface $addressRepository
    )
  {
      $this->addressRepository = $addressRepository;
  }

$address = $this->addressRepository->getById('1');
          if(!empty($address->getId())){
            $subdistrict = '223';
            $address->setData('subdistrict',$subdistrict);
            $this->addressRepository->save($address);
          }

the problem is , it wont save the customer custom attribute data


texts: How to add class in body or in category-view div if current category don't have image

texts:
How to add any class in body or category-view div on category page if current category don't have image assigned.

Having following top container part in the catalog_category_view.xml file.

<referenceContainer name="columns.top">
            <container name="category.view.container" htmlTag="div" htmlClass="category-view" after="-">
                <block class="Magento\Catalog\Block\Category\View" name="category.image" template="Magento_Catalog::category/image.phtml"/>
                <block class="Magento\Catalog\Block\Category\View" name="category.description" template="Magento_Catalog::category/description.phtml"/>
                <block class="Magento\Catalog\Block\Category\View" name="category.cms" template="Magento_Catalog::category/cms.phtml"/>
            </container>
        </referenceContainer>


texts: Magento 2.2.3 upgrade to 2.2.4 giving error

texts:
I'm trying to upgrade my magento 2.2.3 to 2.2.4 through putty:

php70 composer require magento/product-community-edition 2.2.4 --no-update
php70 composer/composer.phar update

and after this I try:

php70 bin/magento setup:upgrade

but here I get this error:

Could not open input file: bin/magento

I have also tryed to rewrite the permissions, but is not this the problem, the thing is the content in bin gets literally deleted.


texts: How rezise the thumbnails image in magento 1?

texts:
The magento thumbnails from the products are wrong format. (square)

I want all the pictures an other format  2/3.

How or where can i change this to get effect?


texts: Magento 2.X: Remove an attribute from product page tabs

texts:
I have an attribute named warranty. I want to show it on top of the page (it is ok and done), but don't need to show it on the description table on product page with other attributes. what should I do?
want to use something like this:
  <?php if($_data['value'] == 'N/A') continue;?> in attributes.phtml but nut use value, use backend_code or frontend_label. but it doesn't work...


texts:
In patching some Magento sites the patch leaves behind a .orig version of some of the files that were patched. I've been removing these from version control but was curious is there's any purpose to them and why only some of the files have .orig files created for them?

I'm also assuming removing them is also best practice as otherwise you're leaving unpatched files within the code base.


texts: Need jquery or javascript function to get round up value of input number

texts:
Following is my script which I am trying to find solution for it. But I actually this function return round of ANS: 2. Eg. If input value is greater than 2.01 then result will be 3. I know round function is not help me to get this kind of answer. please help me to fix this issue.

  <button onclick="myFunction()">Try it</button>


texts: Add attributes to bundle-product options

texts:
How can I display custom product attributes for bundled products options?
Products that are used as bundle-option are not fully loaded, so i cant access all/custom attributes. (Right?)
E.g. I'd like to display short description or thumbnail image or custom attributes ...
I guess this could be possible via XML, but im happy with every idea, that does not use load(option-product) to get custom attributes.
(sorry, still a M2 newbie)


texts: How can i show crosssell products on product page?

texts:
I have added crosssell products to a product but it's only showing on cart page.
I want to show them on product page. How can i do that on Magento 2?


texts: Trouble with Magento Module name in Parallel plesk. Issue seems like with Case sensitivity

texts:
I am having trouble with my Magento module name in parallel Plesk. My module's name is like ComPany/MYMODULE and it works fine in localhost.

But I uploaded it to a live server in Parallel Plesk, I m getting error such as Source model "mymodule/entity_attribute_source_yesnodefault" not found for attribute "mymodule_update_images"

It seems case-sensitivity plays the role here. So I changed the MYMODULE folder to my module and changed ComPany/mymodule/etc/config.xml appropriately. But no use! Still, the local works fine and the Live server gives the error!

How can I overcome this error? If you have any Idea, share...


texts:
Admin Panel all functionalities are working but the style is not working.

The console shows the following errors:

public_html/skin/adminhtml/default/default/boxes.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/default/default/reset.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/default/default/custom.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/default/default/sm/cameraslide/css/cameraslide.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/default/default/sm/cameraslide/css/font-awesome.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/base/default/aw_blog/css/style.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/default/default/sm/cameraslide/css/cameraslide.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/default/default/boxes.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/base/default/aw_blog/css/style.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/default/default/sm/cameraslide/css/font-awesome.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/default/default/custom.css Failed to load resource: the server responded with a status of 404 (Not Found)
public_html/skin/adminhtml/default/default/reset.css Failed to load resource: the server responded with a status of 404 (Not Found)


texts: Magento 2: Custom frontend route thinks its in the admin area

texts:
I am creating a custom route as an example. Here is the code;

In etc/frontend/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="foo" frontName="foo">
            <module name="[Vendor]_[ModuleName]" />
        </route>
    </router>
</config>

In Controller/Index/Index.php

<?php

namespace [Vendor]\[ModuleName]\Controller\Index;

use Magento\Framework\App\Action;
use Magento\Framework\Controller\ResultFactory;

class Index extends Action\Action
{
    public function execute()
    {
        $page = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
        return $page;
    }
}

Now if I go to /foo I get a blank page, when I am expecting to at least see the site outline with an empty content area.

If I look at the source I see html but nothing in the body. The interesting thing are the classes on the body;

class="foo-index-index page-layout-admin-1column"

Now I expect to see foo-index-index but why would page-layout-admin-1column exist. I do not have a layout file for this handle.


texts: Required field error in Billing Information

texts:
We always seem to be having issues with the checkout.

Customer cannot get past the billing information section, they click continue and it keeps saying required field, and it won't let them go any further, however, everything is filled in correctly.

How do I fix this, please?


texts: How to update admin front end invoice/order numbers

texts:
I've changed increment_id directly to the database table mage_sales_flat_invoice only one row, in order to set a special invoice number.

My problem is related at front end of administration invoice page.

How do I update invoice numbers? They seems to be cached.


texts: Override CSS for only login page via local.xml

texts:
How can I override a CSS class selector only my footer on the login page?

login page is the default login page which is copied and loaded from

  /theme/package/template/persistent/customer/form/login.phtml

The page identifier seems to be:

  customer-account-login

But my CSS has no effect. How can I do this?

'local.xml' contains this code:

<?xml version="1.0"?>
  <layout version="0.1.0">
     <!-- Login Page -->
     <customer-account-login>
        <reference name="head">
          <action method="addItem">
            <type>skin_css</type>
            <file>css/login.css</file>
          </action>
        </reference>
     </customer-account-login>
  </layout>

'login.css' file is this (which what I want to apply to the footer container):

.footer-container { height:185px; padding:0px 0px 10px 0px; position:absolute; bottom:0; width:98%; }


texts: Theme displays on localhost and not on domain server, please help!

texts:
For some odd reason my theme is not displaying on the live server but on the localhost it shows perfectly fine. What could be the cause of this issue?

Thanks in advance!


texts: How to extend Configurable Class with session data

texts:
I'm trying to extend the class \Magento\Swatches\Block\Product\Renderer\Configurable to access session data.
So I did this as proposed on so many stacks and tutorials.

class ExtendConfigurable extends \Magento\Swatches\Block\Product\Renderer\Configurable
{
    public function __construct(
        Context $context,
        ArrayUtils $arrayUtils,
        EncoderInterface $jsonEncoder,
        Data $helper,
        CatalogProduct $catalogProduct,
        CurrentCustomer $currentCustomer,
        PriceCurrencyInterface $priceCurrency,
        ConfigurableAttributeData $configurableAttributeData,
        SwatchData $swatchHelper,
        Media $swatchMediaHelper,
        array $data = []
    ) {
        parent::__construct($context, $arrayUtils, $jsonEncoder, $helper, $catalogProduct, $currentCustomer, $priceCurrency, $configurableAttributeData, $swatchHelper, $swatchMediaHelper, $data);
    }

This works. So now I want to inject the session data:

class ExtendConfigurable extends \Magento\Swatches\Block\Product\Renderer\Configurable
{
    public function __construct(
        Context $context,
        ArrayUtils $arrayUtils,
        EncoderInterface $jsonEncoder,
        Data $helper,
        CatalogProduct $catalogProduct,
        CurrentCustomer $currentCustomer,
        PriceCurrencyInterface $priceCurrency,
        ConfigurableAttributeData $configurableAttributeData,
        SwatchData $swatchHelper,
        Media $swatchMediaHelper,
        array $data = [],
        Magento\Customer\Model\Session $session
    ) {
        parent::__construct($context, $arrayUtils, $jsonEncoder, $helper, $catalogProduct, $currentCustomer, $priceCurrency, $configurableAttributeData, $swatchHelper, $swatchMediaHelper, $data);
        $this->customerSession = $session
    }

But all I get is:

  must be an instance of Magento\Catalog\Model\Session, none given

How can I extend that class to access session data?


texts: Delete all product from one of storeviews

texts: considering that I can not go to adminpanel--> catalog-->product page due to errors I have, how can I delete all products from one of my store views?


texts: Magento 1.6.1.0 compatible with PHP 5.6?

texts:
I have two Magento installations running versions 1.6.1.0 and 1.7.0.0. I am looking to upgrade my server to PHP 5.6 and Google wasn't particularly convincing that this is possible.

Can someone please confirm with certainty if 1.6.1.0 and 1.7.0.0 run properly under PHP 5.6?


texts:
I want to create magento theme and inherit the default functionality can any one tell me verified view how to create it.I used many tutorial but not for good

thanks in advance .


texts:
Hi Everyone I need to have see more button under my testimonial section so that on clicking it should redirect to the page where all the testimonials located.
Please see my images I want button in the place of see more.


texts: Edit billing and shipping address in email template

texts:
In magento 2 how to remove coma from billing and shipping address of order confirmation email template.

Order confirmation mail is called from "order_new.html" file.

In this file billing address is called as"{{var formattedBillingAddress|raw}}" this line and the shipping address is called as "{{var formattedShippingAddress|raw}}".

In which file i have to edit? How can i do this?
Please help me to achieve this.


texts: Simple Extension to Run on every page on Frontend

texts:
I need to create a simple functionality on Magento 2 to check if user is logged in or not on the front-end.

I want to run it on every front-end page, and set some certain session variables for logged in and non-logged in users.

So far I have created the module's required directories, created config and activated the module.

What I need to know is that should I use events/observer or helpers/controllers for the purpose or any other simpler way?

P.S. I do not need anything to display on the front-end, just some operation on server side.

Thanks


texts: Magento 2.2.3 Which is the right way to get logged Customer?

texts:
I want to check if a customer is logged or not. And if he/she logged, I want to get the customerId. I just googled but I could find 2 ways.
One is to use CustomerSession:
Magento\Customer\Model\Session
Another one is to use Customer\Model\Context.
Magento\Customer\Model\Context::CONTEXT_AUTH

Which is right way?
These 2 articles show different way. I am really confusing what I should use.
http://www.blogtreat.com/get-logged-in-customer-data-in-magento-2/

Magento 2: get customer id of logged in user with cache enabled

Thanks.


texts:
Can anyone help me how to override the following files to custom module

vendor/magento/module-sales/Model/Order/Item.php

vendor/magento/module-sales/Api/Data/OrderItemInterface.php

thanks


texts: How to delete object from collection in magento2

texts:
How to remove any object from magento 2 collection.
If we have collection of products and we want to delete product which is at first index . how to delete that product without deleting it from database?

$collection->addAttributeToSelect('*')->addFieldToFilter('attribute',$somevalue);

foreach ($collection as $key => &$value) {
              if($key == 1){
                //// how to unset this index in collection ?
              }

            }


texts: How can check the email address exist or not before send the reset link while forgot password in magento 2.3.4?

texts:
Please help me to check is email exists or not in while password reset. Magento 2.3.4
$resultRedirect = $this->resultRedirectFactory->create();
    $email = (string)$this->getRequest()->getPost('email');
    if ($email) {
        if (!\Zend_Validate::is($email, \Magento\Framework\Validator\EmailAddress::class)) {
            $this->session->setForgottenEmail($email);
            $this->messageManager->addErrorMessage(
                __('The email address is incorrect. Verify the email address and try again.')
            );
            return $resultRedirect->setPath('*/*/forgotpassword');
        }

        try {
            $this->customerAccountManagement->initiatePasswordReset(
                $email,
                AccountManagement::EMAIL_RESET
            );
        } catch (NoSuchEntityException $exception) {
            // Do nothing, we don't want anyone to use this action to determine which email accounts are registered.
        } catch (SecurityViolationException $exception) {
            $this->messageManager->addErrorMessage($exception->getMessage());
            return $resultRedirect->setPath('*/*/forgotpassword');
        } catch (\Exception $exception) {
            $this->messageManager->addExceptionMessage(
                $exception,
                __('We\'re unable to send the password reset email.')
            );
            return $resultRedirect->setPath('*/*/forgotpassword');
        }
        $this->messageManager->addSuccessMessage($this->getSuccessMessage($email));
        return $resultRedirect->setPath('*/*/');
    } else {
        $this->messageManager->addErrorMessage(__('Please enter your email.'));
        return $resultRedirect->setPath('*/*/forgotpassword');
    }


texts: Switch language and redirect to specific CMS page

texts:
We have a language select page which the user gets presented with when they first enter the site, we want to redirect the user to the "/home" CMS page when they select a language.

I know that $_lang->getCurrentUrl(); redirects to the current URL, and $_lang->getHomeUrl(); redirects to the home page (which is currently this language select page) how can we get it to do the following $_lang->getPageUrl("home"); as this snippet doesn't do the job.

Cheers, C.


texts:
It seems like I am missing the sidebar on my search result page, for more detail refer to the image below. How do I add the same sidebar that, I have on the category page?
I have tried adding widgets but that didn't work for me.


texts: Magento2: issue with elasticsuite (elasticsearch7) catalog_product index does not exist yet

texts:
Magento 2.4.1 I install elasticstuite on elasticsearch7
When I fire up a category, I get an error:
1 exception(s):
Exception #0 (LogicException): catalog_product index does not exist yet. Make sure everything is reindexed.

Exception #0 (LogicException): catalog_product index does not exist yet. Make sure everything is reindexed.
<pre>#1 Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\AttributeList->getMapping() called at [vendor/smile/elasticsuite/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php:127]
#2 Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\AttributeList->getAttributeCollection() called at [vendor/smile/elasticsuite/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product.php:109]
#3 Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product->l

What I do:
restart elasticsearch
bin/magento indexer:reset
bin/magento indexer:reindex
Still the same issue. Can anyone have any solution?


texts: how to get the full credit card number in my observer class on sales_order_save_before event?

texts:
I wanna get the credit card number when the user hit the place order button. Right now I am using this event: sales_order_save_before and using this code to get the card number but gets no value.
It's possible???

NOTE: I am using authorize.net and direct post payment methods.

$session  = Mage::getSingleton('checkout/session');
            $quote_id = $session->getQuoteId();
            $quote  = Mage::getModel('sales/quote')->load($quote_id );
            $paymentData = $quote->getPayment()->getData();
            $cc_number = Mage::getModel('payment/info')->decrypt($paymentData['cc_number_enc']);
            echo $cc_number;  // getting no value here!!!


texts: Relating a product with attribute which has numerious options

texts:
Scenario

The site i am working on sells universities/institutes/school graduation growns. Insitially i was thinking about associating all institutes as options of an attribute but, what i am come to know now is they have 8K institutes to relate.

Problem

I have around 3K plus SKUs and 8K institutes to related with those. I can't think of solution with regular attribute and institutes as options to choose.

In these situations how do we manage in magento ? My question doesn't contain the programming part but it's kinda serious issue when one confronts, so i guess it's right to ask here..


texts: Need Help? In one shopping cart price rule can we create two discounts 10% and 5% for 2 categories or more?

texts: We sell copier parts, for one manufacturer Konica Minolta we want to give 10% off and for other manufacturer Ricoh we want to give 5% off. So in shopping cart if customer buys products from both manufacturers, both discounts which are different 10% and 5%should be applied in same checkout when he applies the coupon code. So is it possible to create one shopping cart price rule for 2 categories are more with different percentages of discounts ? Hope I explained well if any confusion you can ask. I need help on urgent basis.We have magento 1.9 on our website


texts:
I've got problem with default translation built in magento 2. A made static content deploy, file js-transation.json generated properly but strings didn't translated.
Site: test-php.pl
Version magento 2.1


texts: Magento Admin Error Cannot find Zend_Http_Header

texts:
Class 'Zend_Http_Header_HeaderValue' not found in /lib/Zend/Http/Response.php on line 532

I got this error when accessingmy magento admin. Anyone got this error? and how did you manage to fix this error?


texts: SQLSTATE[42S02]: Base table or view not found in extension

texts:
we installed this : https://www.magentocommerce.com/magento-connect/auto-invoice-by-plumrocket-inc.html

we are facing error here

    query was: DELETE FROM plumbase_product WHERE
`date` < '2016-05-09 00:44:00

edit

core_translate`.`string`, `core_translate`.`translate` FROM `core_translate` WHERE (store_id IN (0 , :store_id)) AND (locale = :locale) ORDER BY `store_id` ASC

'
please help me to find solution


texts: Magento 2 generates thousands of temp table queries on product update

texts:
I have a Magento 2.2.5 store with ~20k products and ~250 categories arranged in a tree of maximum 2 sub categories.

One of the top categories has 5k products and when I try to remove a product from the category, or remove the category for a specific product the server takes more than 2 minutes and times out.

After reading the general_log, I saw thousands of queries like this:

SELECT `e`.* FROM `tmp_select_e5e424ef98e4a8a4026e18df9d8088e0` AS `e` WHERE (hash_key = '1_44083')

peaking the database server to 100%:

I think this has something to do with url_rewrites, but I can't seem to understand how is this a problem with only 5k products.

Are there any configurations I can set maybe loosing functionalities, to be able to do something as simple as removing a product from a category?

Thanks a lot.


texts: Magento 2 - How to upload image to REST API (POST)

texts:
I'm working with a Magento 2 project that need to upload image using a POST endpoint

How can I send image content to this endpoint?

Or I have to base64 the image at client side and send the base64 content to POST endpoint?

Thank you very much.


texts: Magento 2 Add extension attribute in product list

texts:
I want to add extra data in product list rest api using extension attribute via Plugin in Magento 2 but it's not working.

> Uncaught TypeError: Argument 2 passed to
> Vendor\ModuleName\Plugin\ProductPlugin::afterGetList() must be an
> instance of Magento\Catalog\Api\Data\ProductSearchResultsInterface,
> instance of Magento\Framework\Api\SearchResults given

extension_attribute.xml

<extension_attributes for="Magento\Catalog\Api\Data\ProductInterface">
    <attribute code="seller" type="Magento\Catalog\Api\Data\CustomOptionInterface[]" />
</extension_attributes>

di.xml

<type name="Magento\Catalog\Api\ProductRepositoryInterface">
    <plugin name="add_more_info_in_product" type="Vendor\ModuleName\Plugin\ProductPlugin" sortOrder="15" />
</type>

Vendor\ModuleName\Plugin\ProductPlugin.php

use Magento\Catalog\Api\Data\ProductInterface;

class ProductPlugin
{
    protected $productExtensionFactory;
    protected $productFactory;

    public function __construct(
        \Magento\Catalog\Api\Data\ProductExtensionFactory $productExtensionFactory,
        \Magento\Catalog\Model\ProductFactory $productFactory
    )
    {
        $this->productFactory = $productFactory;
        $this->productExtensionFactory = $productExtensionFactory;
    }

    public function afterGet(
        \Magento\Catalog\Api\ProductRepositoryInterface $subject,
        \Magento\Catalog\Api\Data\ProductInterface $entity
    )
    {
        /** @var ProductInterface $product */
        $product = $entity;
        // Fetch the raw product model (I have not found a better way), and set the data onto our attribute.
        //$productModel = $this->productFactory->create()->load($product->getId());
        $extensionAttributes = $product->getExtensionAttributes(); /** get current extension attributes from product **/
        $seller = [
        'id' => (int) 10,
        'name' => 'seller name',
        'image' => null
    ];
        $extensionAttributes->setSeller($seller);
        $product->setExtensionAttributes($extensionAttributes);
        return $product;
    }

    public function afterGetList(
        \Magento\Catalog\Api\ProductRepositoryInterface $subject,
        \Magento\Catalog\Api\Data\ProductSearchResultsInterface $searchCriteria
    ) : \Magento\Catalog\Api\Data\ProductSearchResultsInterface
    {
        $products = [];
        foreach ($searchCriteria->getItems() as $entity) {
            /** @var ProductInterface $product */
            // Fetch the raw product model (I have not found a better way), and set the data onto our attribute.
            //$productModel = $this->productFactory->create()->load($product->getId());
            $extensionAttributes = $entity->getExtensionAttributes(); /** get current extension attributes from product **/
            $seller = [
        'id' => (int) 10,
        'name' => 'seller name',
        'image' => null
    ];
            $extensionAttributes->setSeller($seller);
            $entity->setExtensionAttributes($extensionAttributes);

            $products[] = $entity;
        }
        $searchCriteria->setItems($products);
        return $searchCriteria;
    }
}

But the result for product list is null:

{
    "status_code": 200,
    "reason_phrase": "OK",
    "body": null
}

So any suggestion about that please?


texts: Is it detrimental to create a module with numerous controller files?

texts:
When working with one module, although only specifying a single router in config.xml, it is possible to use the adminhtml.xml file to specify "routes" (note the quotation marks) (in the form of menu items) in the <action/> tag, which will then point to a subsequent controller file.

For instance, if you declare the following in your module's adminhtml.xml file:

...
<namespace_module_coolfunction translate="title" module="namespace_module">
    <title>Cool Function</title>
    <action>adminhtml/coolfunction</action>
</namespace_module_coolfunction>
...

When Magento's adminhtml (or standard) router tries to match this route & controller, it will find the Namespace_Module's CoolfunctionController.php file. Because no action is defined, it will fall back to the default indexAction() method, which can be defined within said controller file.

Is this method frowned upon - and if so - are there detrimental effects of hosting a single module with multiple controller files?


texts:
Anyone have any idea why I can't rewrite the Mage_Page_Block_Html_Head block?

My config.xml file looks like this:

<config>
    <modules>
        <Mymodule_Robots>
            <version>0.1.0</version>
        </Mymodule_Robots>
    </modules>
    <global>
        <blocks>
            <page>
                <rewrite>
                    <html_head>Mymodule_Robots_Block_Html_Head</html_head>
                </rewrite>
            </page>
        </blocks>
    </global>
</config>

If I have an XML error in the file it shows up in the error log, so the file itself is being loaded in but it isn't overriding the Block.

My block looks like this (but I'm got getting any errors about it not being found or anything like that):

class Mymodule_Robots_Block_Html_Head extends Mage_Page_Block_Html_Head {
    public function __construct(){
        #nothing logging
        Mage::log('test');
    }
    /**
     *
     * Override robots link on certain pages.
     * @return string
     *
     */
    public function getRobots(){
        Mage::log('test');
        if (empty($this->_data['robots'])) {
            $this->_data['robots'] = Mage::getStoreConfig('design/head/default_robots');
        }
        return 'test'; // $this->_data['robots'];
    }
}

It's an older version of Magento: 1.5.1


texts:
When a customer chooses to order a product and ship it directly to the customer or multiple customers - we charge a drop ship fee of £3 per pack/deliver

Can this be done through magento?


texts: Add customer custom-attribute in the customer address edit form and save DB

texts:
How to add a new field to this section and save DB:

Please help me.


texts: Designer, (Manufacturer) display above Product Name on all views

texts:
I'm totally new to Magento. But I need to show the manufacturer name above the Product name on the product list page (grid and list) and on the actual Product page. See pics as referenceenter

I am using magento 1.9.1


texts:
When i look at magento 2 core, in some modules API directory is present and in some modules there is no API directory.

API Directory is used for implementing Web services(SOAP,REST) or it has other purpose too??


texts:
I am successfully getting access token, but when I call customer service it is throwing error.

  Error:Bad Request/Unauthorized

for this I have tried below code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Http;
using System.Net.Http.Headers;

namespace ConsoleApplication2
{

    class Program
    {

        private const string URL = "http://192.168.0.52/magento214/index.php/rest/V1/integration/admin/token";
        private const string URL1 = "http://192.168.0.52/magento214/index.php/rest/V1/customers/";
        private const string DATA = @"{""username"": ""admin"",""password"": ""pass@word1""}";
        private const string DATA1 = @"{""id"": ""1""}";

        static void Main(string[] args)
        {
            try
            {
                AddComponent();
            }
            catch (Exception ex)
            {
                throw;
            }
        }

        private static void AddComponent()
        {

            try
            {
                System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
                //client.BaseAddress = new System.Uri(URL);
                byte[] cred = UTF8Encoding.UTF8.GetBytes("username:password");
                client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", Convert.ToBase64String(cred));
                client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

                System.Net.Http.HttpContent content = new StringContent(DATA, UTF8Encoding.UTF8, "application/json");
                HttpResponseMessage messge = client.PostAsync(URL, content).Result;
                string description = string.Empty;
                if (messge.IsSuccessStatusCode)
                {
                    string result = messge.Content.ReadAsStringAsync().Result;
                    description = result;
                    AddComponent1(description);
                }
                else
                {
                    string result = messge.Content.ReadAsStringAsync().Result;
                    description = result;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }

        private static void AddComponent1(string key)
        {

            try
            {
                var rowString = key.Replace('"', ' ').Trim();
                System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
                //client.BaseAddress = new System.Uri(URL);
                byte[] cred = UTF8Encoding.UTF8.GetBytes(rowString);
                client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", Convert.ToBase64String(cred));
                client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

                System.Net.Http.HttpContent content = new StringContent(DATA1, UTF8Encoding.UTF8, "application/json");
                HttpResponseMessage messge = client.PostAsync(URL1, content).Result;
                string description = string.Empty;
                if (messge.IsSuccessStatusCode)
                {
                    string result = messge.Content.ReadAsStringAsync().Result;
                    description = result;
                    getCustomerList(description);
                }
                else
                {
                    string result = messge.Content.ReadAsStringAsync().Result;
                    description = result;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }

}

Any help on this?


texts: Root slideshow, home page banner image upload error "error": Disallowed file type.","errorcode":0 magneto 1 , please solve


texts: What is the correct way to update a value to be NULL on a Magento model?

texts:
I am having an issue getting a custom model's value to update to NULL.

$model = Mage::getModel('custom/model')->load($id);
$model->setCustomValue(NULL);
$model->save();

This code does not update the field custom_value in the database, and the database value accepts NULL values (Manually setting NULL in the database works fine).

EDIT:
As Tim mentions below using Zend_Db_Expr("NULL") does set the value to null, could anyone explain why this is required in Magento and not just simply a php NULL ?


texts: Is it possible to add the rwd minicart to my own custom theme, and if so how could I do it

texts:
Is it possible to add the rwd minicart to my own custom theme? and if so how could I do it?

I have tried copying minicart.phtml and items.phtml to my own theme and trying to call minicart.phtml in my local xml but it doesn't appear to be working


texts:
I am trying to get rewrite product url from the load product in custom module. I am getting url in http://localhost/m2/catalog/product/view/id/1401/category/23/ format .

But I want http://localhost/m2/juno-jacket.html

Here is the code

in constructor

public function __construct(
    \Magento\Catalog\Helper\Product $catalogProductHelper,
) {
    $this->catalogProductHelper = $catalogProductHelper;
}

Custom function

public function abc(){
    $product_id = '123';
    return  $this->catalogProductHelper->getProductUrl($product_id);
}

abc() method return url like http://localhost/m2/catalog/product/view/id/1401/category/23/


texts: Experience with using Aurora RDS for Magento 2

texts:
We are looking at using Aurora RDS for new Magento 2 implementations, however, I have not found many people posting about their experiences with it on-line. Amazon claims that it is a "drop-in replacement for MySQL", but I was looking to see what everyone's real-world experience is with the database.

I know that we will have to change all of the tables to be InnoDB, but are there any other changes we should make?
What about using read-replicas. Aurora is supposed to be faster with syncing, but is it fast enough?
Is it noticeably faster than MySQL or MariaDB in real-world usage, not just during load tests?


texts: Magento 2: Running any command getting error Class Magento\Webapi\Model\Cache\Type\Web Api\Interceptor does not exist

texts:
Running any command

s:up , s:di:c s:s:d -f cache getting error

  Class Magento\Webapi\Model\Cache\Type\WebApi\Interceptor does not
  exist

And like below images, any help will be appreciate.


texts: Magento2 unset "USE DEFAULT " for all product specific stores

texts:
I have Magento2 with 2 stores in that i need to deselect use default for all products specific stores.

can anyone help me?


texts: Magento 2: Override \Magento\Checkout\Model\Cart

texts: How can we override Magento\Checkout\Model\Cart class in Magento 2 ?


texts: How to convert shipment pdf to rtl direction?

texts:
I am trying to convert the pdf direction, to RTL.

Any one know how i can do this or any extension that will help to do this Quickly.


texts: Change in Menu of Admin Panel in Magento

texts:
I want to move menu in another menu.
For example in this image in menu(admin Panel), I want to move MagentoGarden into ProductContact.
How can I do this?
Any suggestions please or any site reference in which I can get answer for this query.


texts: Magento 2 - How to set a maximum order qty of individual products?

texts:
I am trying to figure out how to set the maximum qty allowed in a shopping cart for an individual product.

In my case: Most products can be added to the cart as many times as they want, but I have a few products, that are configurables that can only be added once to the shopping cart per order.

In my research through the internet I found a few stackoverflow post and articles (below):
https://stackoverflow.com/questions/27982651/magento-how-to-set-a-minimum-order-quantity-of-individual-simple-products

http://www.templatemonster.com/help/magento-how-to-set-minimummaximum-quantity-of-products-per-order.html#gref

where in Magento 1.9 you could set the Maximum and Minimum Qty Allowed in Shopping Cart per product. However, I haven't been able to find how to do this in Magento 2, I only found the global configurable.

If there is no way to do it through the admin, how would I go about to do this in code.


texts: Get how many times a rule was used to buy

texts: Would there be any way for me to know how many times a promotion rule was used to buy products in magento? Is there a table that saves this data?


texts: Handle for Category page when filter is applied

texts:
I want to set

<action method="setRobots">
    <value>NOINDEX,FOLLOW</value>
</action>

For category page but only when any filter is selected.

So I did the following..

<catalog_category_layered translate="label">
    <reference name="head">
        <action method="setRobots">
            <value>NOINDEX,FOLLOW</value>
        </action>
    </reference>
</catalog_category_layered>

But it's loading that tag when any filter is not selected.

So basically

When URL is like as following

http://www.example.com/category/cate1.html

I want to it to be indexed. But when URL is like following

http://www.example.com/category/cate1.html?size=xl

I don't want it be indexed.

Any suggestion what should I do??


texts: M2: Efficient way to sort by brand label and then by product category

texts:
Early days for me on M2, so struggling with relatively basic things like this - I am trying to figure out an efficient way to retrieve a product collection, then sort it by manufacturer/brand label (rather than the option ID) and then by each category within that brand.

So far, I have the following:

$collection = $this->productCollectionFactory->create();
$collection->setVisibility($this->catalogProductVisibility->getVisibleInCatalogIds());

$collection = $this->_addProductAttributesAndPrices($collection)
        ->addStoreFilter()
        ->setPageSize($this->getPageSize())
        ->setCurPage($this->getRequest()->getParam($this->getData('page_var_name'), 1))
        ->setOrder(array('brand'), $this->getSortOrder());

Is there a way to modify the collection to order the product collection by the brand value rather than the option ID, which is currently what's happening?

Then the more complex part I think is how to order the products by category within each brand, without doing additional DB lookups. There's also the issue in that products can be assigned to multiple categories.

So far, I'm able to split out the products by brand on the frontend with a little bit of logic in the template, however I'm aware of starting to add additional logic which could be potentially be handled in how the collection is filtered.

Any pointers in the right direction greatly appreciated.


texts: The Old SKU can not change on the admin drid

texts:
I have problem with the SKU's changing. Pls help me...
I try to modify the sku's at older products, but after saving the sku's does not changing... in the database is ok but on the admin panel I can see the old sku. At new added products no problem....
Thank you for your help


texts:
I am trying to return a collection of brands in Magento that are grouped by the first letter of the title attribute. I have this but it results in a 500 error on the page in question:

public function getBrandGroupedCollection()
    {

        $brandsCollection = Mage::getModel('shopbybrand/brand')->getCollection();
        $brandsCollection
            ->addStatusFilter()
            ->setOrder('title', 'asc')
        ;
        $brandsCollection->getSelect()->group(substr('title',0,1));
        return $brandsCollection;
    }

How can I group the results by the first letter of the "title" attribute?


texts: I want to calculate shipping price by other way. And it will be written in email to customer. So I want to delete 0,00US$ and keep "Shipping Line". How can I do that. Thank you!


texts:
I just Migrated Mganeto 1.9.* to 2.3.0. All set well but when I open Bundle product that throws an error: This product doesn't exist.
And in log, I got

  :[2019-03-13 09:16:16] main.CRITICAL: SQLSTATE[42S22]: Column not
  found: 1054 Unknown column 'option_value_default.parent_product_id' in
  'on clause', query was: SELECT main_table.,
  option_value_default.title AS default_title,
  IF(option_value.title IS NOT NULL, option_value.title,
  option_value_default.title) AS title FROM
  catalog_product_bundle_option AS main_table  INNER JOIN
  catalog_product_entity AS cpe ON cpe.entity_id =
  main_table.parent_id  LEFT JOIN catalog_product_bundle_option_value
  AS option_value_default ON main_table.option_id =
  option_value_default.option_id AND main_table.parent_id =
  option_value_default.parent_product_id AND
  option_value_default.store_id = 0  LEFT JOIN
  catalog_product_bundle_option_value AS option_value ON
  main_table.option_id = option_value.option_id AND main_table.parent_id
  = option_value.parent_product_id AND option_value.store_id = 0 WHERE (cpe.entity_id = '18950') ORDER BY main_table.position asc,
  main_table.option_id asc  {"exception":"[object]
  (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S22]: Column not
  found: 1054 Unknown column 'option_value_default.parent_product_id' in
  'on clause', query was: SELECT main_table.,
  option_value_default.title AS default_title,
  IF(option_value.title IS NOT NULL, option_value.title,
  option_value_default.title) AS title FROM
  catalog_product_bundle_option AS main_table  INNER JOIN
  catalog_product_entity AS cpe ON cpe.entity_id =
  main_table.parent_id  LEFT JOIN catalog_product_bundle_option_value
  AS option_value_default ON main_table.option_id =
  option_value_default.option_id AND main_table.parent_id =
  option_value_default.parent_product_id AND
  option_value_default.store_id = 0  LEFT JOIN
  catalog_product_bundle_option_value AS option_value ON
  main_table.option_id = option_value.option_id AND main_table.parent_id
  = option_value.parent_product_id AND option_value.store_id = 0 WHERE (cpe.entity_id = '18950') ORDER BY main_table.position asc,
  main_table.option_id asc

Then I wont to create a new bundle product for testing at that time I got another

  error:Exception #0 (Magento\Framework\Exception\LocalizedException):
  The "formElement" configuration parameter is required for the
  "price_type" field.


texts: change custom design of all product via single query or override rule

texts:
I noticed some former developer added custom design to all products. So now there are 1 000+ products and it is impossible to manually edit all of them and change the custom theme value to null so that all products will use the default theme.

How can I do this via Phpmyadim or any easy way like module override?


texts: Authorize.net email receipt does not show shipping address line 2 - How to fix

texts:
Magento's core code does not pass address line 2 to Authorize.net.  This is a problem when Authorize.net is set to send email receipts, which get sent to the customer missing their shipping address apartment number, etc.  (The Magento order confirmation email is fine.)

To replicate the problem:

1) Authorize.net is set to email a receipt.
Meaning, you log in to your authorize.net account > Settings > Email Receipt > Check the box for "Email transaction receipt to customer (if email address is provided)"

2) Customer places an order with address line 1 and 2, then pays via Authorize.net.
FirstName LastName
Address Line 1
Address Line 2 (apt 203)
City, State ZIP

3) OH NO, the customer receives an email receipt from Authorize.net showing only address line 1; it does not show address line 2.  This causes some customers to panic thinking their package will not be delivered correctly.

Update:  I'll post an answer tomorrow.  Not permitted to answer my own question for 8 hours...


texts: Magento 1.9.3.8 Easy way to check if all the products assigned to any category (category products) are enabled?

texts:
Is there an easy check for this that works out of the box?: if all the products assigned to any category (category products; in the configuration of any category in the backend) are enabled? -if loop or something-.

All products are simple products.


texts: Magento InfiniteScroll not working with AheadWorks Layered Navigation

texts:
I am using https://github.com/Strategery-Inc/Magento-InfiniteScroll extesion for infinite scroll with porto + AheadWorks Layered Navigation
It's stops working when we apply any sorting?
Do you have any idea how to resolve it.


texts: Remove fields from magento's registration page

texts: I am using magento1.9. Now I want to remove the fields of Street Address, City, State/Province, Zip/Postal Code on the registration page. What should I do? thank you very much.


texts: Magento 2: Set all option selected in multiselect UI form?

texts:
<field name="customer_group">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Magento\Customer\Model\ResourceModel\Group\Collection</item>
        <item name="config" xsi:type="array">
            <item name="sortOrder" xsi:type="number">50</item>
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" translate="true" xsi:type="string">Customer Group</item>
            <item name="formElement" xsi:type="string">multiselect</item>
            <item name="source" xsi:type="string">popup</item>
            <item name="dataScope" xsi:type="string">customer_group</item>
            <item name="default" xsi:type="string">1</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">false</item>
            </item>
        </item>
    </argument>
</field>


texts:
Magento buttons have a button/span/span structure, which I thought was silly at first. But it's really helpful for styling them, because those two elements give a designer an awful lot of flexibility without having to change the templates.

This got me to thinking that writing the templates for modules is more of a technical task than a design one. It's about writing HTML that can be everything to anyone, without any specific layout in mind.

So I have two questions: is the above thought correct, and are there any other similar conventions in Magento that I should bear in mind when writing templates? Things that aren't common sense, but obvious to the experienced developer?


texts: Magento 1.9.2.4 catalogrule_product_price is changed every time a price is updated

texts:
When a price is changed normally, the original price is displayed as a sale on the front end, and the new price is crossed out.

I've found that each time the price is changed, the catalogrule_product_price table is updated and holds onto the original price. Changing the latest rule entry in there will change the price on front end to what it should be. Has anyone run into this before?


texts: Magento 2.3.4 Customer registration email is not sent customer

texts:
In Magento 2.3.4 customer registration, forgot password emails are not working.

Admin configurations are done.

Store > Configurations > Customer > Customer Configurations > Customer New Account Options and Password Options load the templates.

Crontab is also added. But emails are not sending to customer

Is it mandatory SMTP extension in magento 2.3.4 to send an email for customer registration and forgot password?

Please help on this?


texts: Magento 2 Active Mobile Menu width calc() issue being doubled

texts:
On the Magento/Blank theme and themes inheriting from Magento/Blank the mobile menu is expanding too far off the screen when active.

The nav element
.nav section has a width that is calculated as such:

width: calc(100% - 54px)

However the calculated width is near double the width of the html itself. This behavior is also only seen when viewed via responsive emulation (Chrome device mode for example) or on a mobile device. Simply reducing the size of the window will give a proper width.

Has anyone else ran into this same issue? Using the Magento/Luma theme does not have this issue. I cannot provide a url for the site as it is local to my machine and I was unable to find an M2 demo on the internet that is not using Magento/Luma.

Menu in device Mode:

Menu with reduced window size


texts: Notice undefined index all_resource vendor/magento/module-integration/Controller/Adminhtml/Integration.php

texts:
there are 3rd party developers who are trying to set up API account and they got this error. They need to feed product data from their NutriLoader software so they need to set up API account.

They went to below path to set up API account.
System > Extension (Integrations)

System config details are as below:
PHP 5.6.20 and OS Linux


texts: Is it possible to remove blocks on local environement?

texts:
As I have seen in other topics that some things were not working on local environment I was asking myself if it shoukd be the same problem with removing blocks. I have folowed Magento instructions and have looked for same issues but didn't found anything.

In fact I have tried to remove the catalog.compare.sidebar block from

  MAMP/htdocs/mysite/vendor/magento/module-catalog/view/frontend/layout/default.xml

by adding a default.xml file into

  MAMP/htdocs/mysite/app/design/frontend/bertrand/luma_child/Magento_catalog/layout

with

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <body>
    <referenceBlock name="catalog.compare.sidebar" remove="true" />
  </body>
</page>

I have cleared all the caches but,
unfortunately, this doesn't work at all. What is strange is that if I override a phtml file using the same method, there is no problem.

I have also tried with other xml files and it is always the same issue. I should make a mistake or forgot something, but I really don't find and after a full day of investigation I'm lost.

If somebody can help. Thanks in advance


texts: Trying to add date picker to widget admin config

texts:
I have this code in widget.xml

<parameter name="from_date" xsi:type="text" required="false" visible="true"
                   source_model="BSS\BestSelling\Model\Config\Source\DatePicker">
            From Date
        </parameter>

And this is my source model

<?php
namespace BSS\BestSelling\Block;

use Magento\Framework\Registry;
use Magento\Backend\Block\Template\Context;

class DatePicker extends \Magento\Config\Block\System\Config\Form\Field
{
    /**
     * @var  Registry
     */
    protected $_coreRegistry;

    /**
     * @param Context  $context
     * @param Registry $coreRegistry
     * @param array    $data
     */
    public function __construct(
        Context $context,
        Registry $coreRegistry,
        array $data = []
    ) {
        $this->_coreRegistry = $coreRegistry;
        parent::__construct($context, $data);
    }

    protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        //get configuration element
        $html = $element->getElementHtml();
        //check datepicker set or not
        if (!$this->_coreRegistry->registry('datepicker_loaded')) {
            $this->_coreRegistry->registry('datepicker_loaded', 1);
        }
        //add icon on datepicker
        $html .= '<button type="button" style="display:none;" class="ui-datepicker-trigger '
            .'v-middle">Select Date</button>';
        // add datepicker with element by jquery
        $html .= '';
        // return datepicker element
        return $html;
    }
}

But some how I am keep getting this error

Exception #0 (Magento\Framework\Exception\LocalizedException):
Invalid XML in file E:/BSS/Xampp/htdocs/magento2/app/code/BSS/BestSelling/etc/widget.xml:
Element 'parameter', attribute 'source_model': The attribute 'source_model' is not allowed.

Any tips?


texts: Magento 2 admin page redirecting to homepage

texts:
My admin URL redirecting to homepage, I have did lot of efforts to fix admin login link but still it migrating to homepage,

my website link https://www.muzikhausberlin.de/index.php
my admin link https://www.muzikhausberlin.de/admin


texts: Match TLD against known list - Stop alert box

texts:
I've seen lots of people discussing this, but no one has asked the same question / answer I'm looking for here, I currently have a store running fine, on checkout the email is required (as you'd expect) - but if the user enters .com32 I get the following message:

  ‘domain.events’ appears to be a DNS hostname but cannot match TLD
  against known list

This displays as an alert box - i've discovered that the code for the TLD validation is inside of:

  /lib/Zend/Validate/Hostname.php

And have made a copy to local like so:

  /app/code/local/Zend/Validate/Hostname.php

And commented out the following:

if (!in_array($this->_tld, $this->_validTlds)) {
    // $this->_error(self::UNKNOWN_TLD);
    // $status = false;
    // break;
}

My problem is, I want the email form field to show the error message (Please enter a valid email address. For example johndoe@domain.com.), and not an alert.

How would I go about doing this? Is it even possible?


texts:
I am very close probably just an XML mistake somewhere. Please assist.

I'm making a custom module.

The directory structure:

In /var/www/html/magento/app/code/mine/MINE

-etc
--config.xml
-Catalog
--Block
---List.php

My config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Mine>
            <version>0.1.0</version>
        </Mine>
    </modules>
<global>
        <blocks>
            <mine>
                <class>Mine_Block</class>
            </mine>
        </blocks>
    </global>
</config>

My List.php

    class Mine_Mage_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
    {
    protected function _getProductCollection()
    {
             $category_id = 3;
             $category2B = $this->getNameInLayout;
             if($category2B =="itemsShoes"){
                $category_id = 3; //important
                    }
 collection = Mage::getSingleton('catalog/category')->load($category_id)
            ->getProductCollection()
            ->addAttributeToSelect('*');

        return collection;
    }
   public function zetLoadedProductCollection()
    {
    return $this->_getProductCollection();
    }
    }

My module registry in /var/www/html/magento/app/etc/modules

<?xml version="1.0"?>

<config>
    <modules>
        <Mine_Catalog>
            <active>true</active>
            <codePool>mine</codePool>
        </Mine_Catalog>
    </modules>
</config>

It is titled Mine.xml

And finally, my template (slider/shoes.phtml):

<?php
    $_productCollection=$this->zetLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>

<?php echo $this->__('There are no products matching the selection.') ?>

<?php else:
foreach ($_productCollection as $product) {
    echo $product->getName();
    echo "
";
}
?>
<?php endif; ?>

And my local.xml`:

<block type="page/html" name="shoeFinder2" module="mine" template="slider/shoefinder2.phtml">
<block type="mine/list" name="itemsShoes" module="mine" template="slider/shoes.phtml"></block>
<block type="mine/list" name="itemsClothes" module="mine" template="slider/clothes.phtml"></block>
<block type="mine/list" name="itemsTennis" module="mine" template="slider/tennis.phtml"></block>
</block>

So what am I doing wrong? I don't even get a "There are no products matching the selection." from the getProductCollection() attempt, so I know there is a configuration error rather than a collection error.

I just get an empty div.


texts: Set Cron Job on Personal Computer/Server

texts:
Set up WAMP and running Magento off of it on my personal computer.

Don't have a website or anything like that, but need to set up cron job to run every 15 minutes for my Amazon Seller store.

How can I configure this to work?


texts: Remove "Add To Compare" link from below product image in category page

texts:
I followed this tutorial here to remove Add to Compare, it worked. But is their a better way of doing it, like editing local.xml file instead.
How can I remove "View Details" just below it in category page.
By following the steps in point number 1, "Add to Compare" seems to be gone but there remains a lot of empty space. How should I remove it?


texts: How to get a custom customer attribute on the frontend

texts:
I added an extra customer attribute using this code:

$installer->startSetup();

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$entityTypeId     = $setup->getEntityTypeId('customer');
$attributeSetId   = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

$installer->addAttribute("customer", "province",  array(
    "type"     => "varchar",
    "backend"  => "",
    "label"    => "province",
    "input"    => "multiselect",
    "source"   => 'eav/entity_attribute_source_table',
    "visible"  => true,
    "required" => false,
    "default" => "",
    "frontend" => "",
    "unique"     => false,
    "note"       => "province",
    'option' =>
        array (
            'values' =>
                array (
                    0 => 'Rome',
                    1 => 'Milan',
                    2 => 'Florence',
                    3 => 'Naples',
                ),
        ),

));

$attribute   = Mage::getSingleton("eav/config")->getAttribute("customer", "province");

$setup->addAttributeToGroup(
    $entityTypeId,
    $attributeSetId,
    $attributeGroupId,
    'province',
    '999'  //sort_order
);

$used_in_forms=array();

$used_in_forms[]="adminhtml_customer";
$used_in_forms[]="checkout_register";
$used_in_forms[]="customer_account_create";
$used_in_forms[]="customer_account_edit";
$used_in_forms[]="adminhtml_checkout";
$attribute->setData("used_in_forms", $used_in_forms)
    ->setData("is_used_for_customer_segment", true)
    ->setData("is_system", 0)
    ->setData("is_user_defined", 1)
    ->setData("is_visible", 1)
    ->setData("sort_order", 100)
;
$attribute->save();

$installer->endSetup();

It works fine in the backend. How to show it in customer frontend dashboard?
thanks


texts: Automatic group switch of customer after period of time

texts:
Hi guys i have a scenario where the customer gets one month free delivery on all orders which i can move him to a customer group with rules.

how to switch the customer back to general customer group automatically after the one month or two month etc.


texts:
Array
(
    [requestId] => 69a6#16a49c12847
    [result] => Array
        (
            [0] => Array
                (
                    [seq] => 0
                    [marketoGUID] => d6a515c3-b1d4-4b68-bc61-6d40bf0387a5
                    [status] => created
                )

        )

    [success] => 1
)

I need to get status value from this array. I am getting like this $responseDecode['result'][0]['status']. But it's not working


texts: Fooman Speedster Advanced not working after migration to 1.9 from 1.8

texts:
I upgraded my 1.8 installation to 1.9 - during which everything was successful, however my website would only load a blank page.

After some troubleshooting, I traced the problem down to the Fooman Speedster Advanced module. By disabling it, the site came back to life.

I've removed, reinstalled I just cannot get it to work anymore.

On my most recent attempt to re-enable it I received a *There has been an error processing your request": Module "Fooman_SpeedsterAdvanced" requires module "Fooman_Common"

Can anyone point me in the right direction, the minification is a great feature.

Note: I understand that we are not supposed to post questions about modules, I have seen in the past that questions with active developers have been permitted


texts: Magento: Add two products for a category on same product page

texts: I would like to show 2 products on a product page in magento for a category, both having complete details and separate "Add to Cart" buttons. Can anyone give me some directions how can I get this done? I am a newbie and i have a project with this problem.


texts: Magento2: Use Blank-Theme-Icons/Blank-Theme-Icons.woff2 in my custom theme

texts:
In PageSpeed Insights:
Ensure text remains visible during Webfont load
Leverage the font-display CSS feature to ensure text is user-visible while web fonts are loading.

Blank-Theme-Icons/Blank-Theme-Icons.woff2
I want to use this font in my custom theme and adding

font-display :swap


texts: Magento 2: Passing Variables from Controller Action to "View"

texts:
In Magento 1, if you want to pass data from your Controller action to the "View" (i.e. a block in your layout, you can)

Add a value/object to the global registry via Mage::register
Directly fetch a block object and set data properties on the fetched block object after running loadLayout
Call methods on block objects in phtml files, and have the block objects use the model/database layer to read data previously saved in the controller action

Using block object methods to read from the database still appears to work in Magento 2 -- which is appropriate for certain sorts of operations.   However,

There's no longer a global registry in Magento 2 (or is there?)
The layout system now works by creating a page object via a factory, and you can't grab block references the same way you can in Magento 1

Is it possible in Magento 2 to pass data directly from a controller action down to a view? Or is this too direct a pattern for Magento's brave new Design Pattern™ world?  If this is too direct a pattern, what should be doing if there's some calculated information we want to display in a template, but don't want to store that information into a stateful system (i.e. we don't want to save it to the database)

I can think of a few different way to hack this together myself -- but I'm interested in how Magento 2 wants you to do it.

Note: I realize it's possible to fetch a block instance in a controller action using something like this

$resultPage = $this->resultPageFactory->create();
$block = $resultPage->getLayout()->getBlock('catalog.wysiwyg.js');

var_dump(spl_object_hash($block));

The Magento 2 core code does this often.  However -- the block object fetched in the controller object seems to be a different object than is available in a phtml template via either $this or $block (the former ($this) appears to be the object that actually renders the template, whereas the later ($block) appears to be an instance of the Magento Block type).

#File: path/to/template.phtml
var_dump(spl_object_hash($block));
var_dump(spl_object_hash($this));

I say "appears to be" because if I set data in the controller action method, it's not available in the phtml template -- and if I compare the spl_object_hash results above, I get three different hashes.  However, I'm new enough to all this that the above might be some other error I've made -- so if you've been able to set data on blocks and fetch it in a template I'd love to hear about it!


texts:
I have been trying to redirect certain CMS pages done earlier now to respective sub-categories but it seems no method is working. I have tried setting up redirects through URL Rewrites and when unsuccessful then using .htaccess file.

The website in question is https://shop.polarisheadsets.com/au/ while the redirects needs to be:

Redirect 301 /index.php/bluetooth-headsets /headsets/bluetooth-headsets

Same goes for about 5 more links like above. Basically, /index.php/bluetooth-headsets were CMS pages which were used earlier before the Categories and Sub-Categories were designed like they are now. But it seems that no way of redirection is working. I am currently on Magento 1.9.2.

Any help in this regard is highly appreciated. Thank you.


texts: Extend a community module - Inchoo Facebook Login

texts:
I would like to extend a community module. The one I am refering to is the Inchoo Facebook Login.

This module has a class called Inchoo_Facebook_Block_Template and one of the classes methods is:

public function getRequiredPermissions()
{
    return json_encode('email,user_birthday');
}

I would like to create a module that "extends" (is that the correct term in Magento?) this class and changes what the above method returns. At the moment I am editing the method directly to accomplish my task and changing the above method to:

public function getRequiredPermissions()
{
    return json_encode('email,user_birthday,friends_birthday,user_photos,friends_photos');
}

The module I am creating should add extra Facebook permissions to the Facebook Login module but not edit its contents.

Any help is appreciated.


texts:
This may be a pretty basic question, but I can't seem to find any solution for it.
I have an order with two products, but I only have one of them in stock. So I invoice and ship the product I have, but the status of the order remains as "Processing".
I'm not gonna get the other product back in stock, so what can i do to make the order "complete" after invoicing the product i have in stock?


texts:
I have enabled captcha. From my admin panel I now have the problem that it keeps showing an invalid captcha message even when there is no captcha at the Admin Panel login page.

How can I fix it?


texts: Can I make a root language folder in app/locale like in zend?

texts:
I'm a newbie to magento and even zend. I've noticed that in zend lib/Zend/locale/data locales are defined as a base file like en.xml and more locale files like en_uk,en_us.
can I do that in app/locale? what's the best approach in my case?

My case is:
I'm working on a multi-website magento 1.9 each site is related to a certain country all available in english, French, arabic. so the theme must be translated to those languages in all websites and I don't want to use one locale and don't want to rewrite all common strings.


texts: Magento get product ordered qty and in stock qty

texts:
I need the simplest way to fetch the quantity of the product ordered and the qty of product in stock. As on product list page there are many products so fetching in stock qty via

<?php echo (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty(); ?>

is a bit heavy procedure and will result in more load time.

Same for fetching the ordered qty I found below code

$sku = nl2br($_product->getSku());
$product = Mage::getResourceModel('reports/product_collection')
        ->addOrderedQty()
        ->addAttributeToFilter('sku', $sku)
        ->setOrder('ordered_qty', 'desc')
        ->getFirstItem();
echo 'Already Bought ' . (int) $product->ordered_qty;

which seemed a bit heavy to me when running in loop for around 1000+ products.

Kindly suggest the best possible solution which will consume least load time and fires less or no queries to DB.


texts: How to unhide Developer in Magento 2.2.2

texts:
Hi, I am not able to view developer in

Store > Configuration > Advance > ??Developer?? is missing.

What should we do to unhide the Developer section in Magento 2?

I was looking for Minify Js and CSS option.


texts: Call Javascript function in Magento Form

texts:
I have a Form in my Admin view with a small output "console".
I want to update the content of the Console, while the form is submitted.

So here's my outputform.phtml:

    <form id="edit_form" name="edit_form" method="post" action="<?=$this->getUrl('*/*/post')?>" enctype="multipart/form-data">
        <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />

<input name="data" type="file" id="upload" value="UploadData"  accept="text/csv" />

<button onclick="check()" class="scalable save" type="button"> Send</button>

</form>

so after my form is submitted, the  postAction() Method is called in my Controller.php file.

 public function postAction()
    {
        $post = $this->getRequest()->getPost();
        try {
            if (empty($post)) {
                Mage::throwException($this->__('Invalid form data.'));
            }
           catch(){}
         ..............
    }

Now i want to update the outputconsole of my outputform.phtml by calling a javascript function within the file. But how can i call it within the postAction() php method?

Thanks in advance


texts: User already has more than 'max_user_connections

texts:
Yesterday I get issue :

  [2018-09-09 13:04:02] main.CRITICAL: SQLSTATE[HY000] [1203] User
  user_database already has more than 'max_user_connections' active
  connections {"exception":"[object] (Zend_Db_Adapter_Exception(code:
  1203): SQLSTATE[HY000] [1203] User user_database already has more than
  'max_user_connections' active connections at
  /home/czasowe/domains/czasowewyprzedaze.pl/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144,
  PDOException(code: 1203): SQLSTATE[HY000] [1203] User user_database
  already has more than 'max_user_connections' active connections at
  /home/czasowe/domains/czasowewyprzedaze.pl/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128)"}
  []

Anyone know how to solve this issue ?


texts: Magento2 - Adobe XD to Magento2 font size

texts:
On the xd design the font-size is 55 and when I apply this font-size in my Magento layout It is bigger ?

Why is it so?


texts:
I have created a custom block in my module to show the quantity of each product in list.phtml file.
I modify in my custom template list.phtml with the code below

<?php
$myBlock= $block->getLayout()>createBlock('MyCompany\Helloworld\Block\Display');
echo $myBlock->getMyCustomMethod();
?>

but nothing appears and it also destroys the appearance. It only shows one product without any customization.

What am I doing wrong?


texts: Shopping Cart Rule Causing Internal Sever Error 500

texts:
I am trying to configure a shopping cart price rule where if you add 2 or more bundled products from one category you get the discount off the subtotal of the cart. This is the only cart rule on the website. I have it as follows.

If ALL  of these conditions are TRUE :

If total quantity  equals or greater than  2  for a subselection of items in cart matching ALL  of these conditions:
    Category  is  18

Actions:  Fixed Amount discount for whole cart.
Discount Amount: $29.00

This seems like a straight forward discount, and it DOES apply to the correct products in the cart.

The problem arrises when you try and add a configured product to the cart, I am getting a "Internal Server Error 500".   After checking with the hosting company they reported that it is attempting to use a truly massive amount of memory, and even when we allowed it to use ten times a normally allowable amount it still failed. Here is a slow log of the php process erroring out:

[0x000000000df1e2f8] __call() /chroot/home/shopadip/shopadiplayer.com/html/lib/Varien/Object.php:631

[0x00007fffa1344f80] __call() unknown:0

[0x000000000df1e0c8] getOperator()
/chroot/home/shopadip/shopadiplayer.com/html/app/code/core/Mage/Rule/Model/Condition/Abstract.php:297

[0x000000000df1d358] isArrayOperatorType() /chroot/home/shopadip/shopadiplayer.com/html/app/code/core/Mage/Rule/Model/Condition/Abstract.php:557

[0x000000000df1c0c0] validateAttribute() /chroot/home/shopadip/shopadiplayer.com/html/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php:523

[0x000000000df1bbe8] validate() /chroot/home/shopadip/shopadiplayer.com/html/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php:70

[0x000000000df1b730] validate() /chroot/home/shopadip/shopadiplayer.com/html/app/code/core/Mage/Rule/Model/Condition/Combine.php:307

[0x000000000df1b1e8] validate() /chroot/home/shopadip/shopadiplayer.com/html/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php:216

[0x000000000df1adb8] validate()
/chroot/home/shopadip/shopadiplayer.com/html/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php:216

[0x000000000df1adb8] validate() /chroot/home/shopadip/shopadiplayer.com/html/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php:117

[0x000000000df1a870] validate() /chroot/home/shopadip/shopadiplayer.com/html/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php:219

When I turn the shopping cart rule to inactive, all products are added to the cart without error.  I cannot find any threads about server errors when using cart rules. Please help.

Magento CE 1.9.1

Thanks,


texts:
I want to display "fancybox" popup with a custom form and a custom action in button click. I have refered the following link: Make a Popup window showup on clicking a html link.

But where can I add the custom form content to dispaly in popup?


texts: Magento 2 checkout page add class to shipping method on click event

texts:
I want to add "active" class on shipping method selection.
Means If I change shipping method then "active" class automatically added to newly selected shipping method and removed from the old selection.

Please see attached image.

I want to use knockout js and I am new to knockout js. Please help me.

Regards

Hiren Shah


texts:
i am facing a problem in my custom module. my configuration cache is getting invalidate and when i click on pager or Pagination link, the phtml renders in URL Bar.

URL Bar:

and the block is being duplicate after the page loads.


texts: Out of stock item not changing even the quantity is greater the 0

texts:
I have version 1.9 loaded the problem is, I update the stock via csv file. When the item goes 0 it change to "out of stock" but when the quantity increase greater then 0 it doesn't change back to "in stock". It still says quantity 29 "out of stock" and all out of stock items do not show on our front end. so I am losing customers on item which I actually have in stock.
I have over 50000 items so can not change everything manually.

Any idea how can I resolve this issue please? Magento should change the status automatically when quantity become greater than 0.